Supabase SSR Auth + Next.js 15 Canary. Async cookie questions
Answered
American Crocodile posted this in #help-forum
American CrocodileOP
With the latest change to async cookie in Canary I'm getting this error from my supabase next.js auth ssr setup (https://supabase.com/docs/guides/auth/server-side/nextjs)
In route (route here....) a cookie property was accessed directly with
that is after using the codemods, there are 2 uses of cookies().getAll() one on the middleware and one to create the supabase server client.
Is there any way to avoid that error, or that is a missing functionality on the supabase side?
In route (route here....) a cookie property was accessed directly with
cookies().getAll()
. cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apisthat is after using the codemods, there are 2 uses of cookies().getAll() one on the middleware and one to create the supabase server client.
Is there any way to avoid that error, or that is a missing functionality on the supabase side?
Answered by joulev
looks like you need to make your server
createClient
an async function3 Replies
looks like you need to make your server
createClient
an async functionAnswer
American CrocodileOP
Hum, that sounds right. So i can await the cookie instead of using the the codemod change with the unsafe type.
Thanks