-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localStorage is not defined - with SSR (NextJS) #802
Comments
@stolinski Please do!! I'm currently looking to do the same thing, would really appreciate your PR! I'm sure @pradel will be happy to review and merge it too! Could make a nice example, and be on the docs/homepage. I think it should be fairly easy to pass a different storage like in the cookbook for react-native:
but with the proper cookieStorage edit: Something like mixing these: https://github.com/zeit/next.js/tree/canary/examples/with-cookie-auth |
The solution would be to just check to see if localStorage exists before calling it. Unfortunately, I haven't had the time to dive in yet as I was unable to get started with the repos locally following the getting started docs. I need to find some time to dedicate to figuring that out. |
I think @pradel already fixed this on my PR
I’m on a cruiseship in a transatlantic trip, so my wifi sux big time! But please tell me how can I help you @stolinski. I’ve had to use npm install and not yarn in some of the packages for them to work in my local machine. And also use yarn link to use some local packages like @accounts/client to test the nextJS example with the cookie storage ;) |
There are someone example the accountsjs con nextjs ? if exists could you help me |
Trying to use with NextJS and I'm getting "localStorage is not defined". Should be an easy enough fix. I can try and submit a PR if you would like
The text was updated successfully, but these errors were encountered: