-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
createServerClient deprecated? #358
Comments
createServerClient has deprecated out get() and set() in favor of getAll() and setAll() Supabase team has published the recommended replacement code, which I'm transplanting over here. See https://github.com/supabase/supabase/blob/e77f8b9f398a8436aa37f93b443620081211e1bc/apps/docs/content/guides/auth/server-side/nextjs.mdx?plain=1#L221-L283 Solves vercel#358
Ported the latest code over from the Supabase docs and opened a PR :) |
I have updated my middleware (updateSession) as suggested. I am getting intermittent 502 errors, which I can resolve by deleting cookies for the site and re-logging on. When in the 502 'dead-end', if I comment out
The 502 error disappears and the page renders. I have spent hours trying to catch errors in ever more granular ways but I'm none the wiser. Every solution involves preventing a set cookies call in some way. I am going to open a discussion in supabase '502 Errors with updated createServerClient code', so as not to hijack this thread. |
Discussion here. https://github.com/orgs/supabase/discussions/30185 |
Hey there! I'm noticing that this line has been marked deprecated in @supabase/ssr. It says the get/set/remove needs to be replaced with getAll/setAll and that the current method won't be supported in the next release. I haven't dug in much further but wanted to raise the issue here as soon as I noticed it.
https://github.com/vercel/nextjs-subscription-payments/blob/25a19504c85a2353f23e907521d0cdb1979c66d6/utils/supabase/server.ts#L10C10-L10C28
The text was updated successfully, but these errors were encountered: