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
[Error]: Dynamic server usage: Route couldn't be rendered statically because it used cookies. #22718
Comments
@leonardoparisii Hey, have you made any progress on this? I've run into the same issue and spent hours looking for solutions with no success. |
Actually yes, using @supabase/ssr package instead of using @supabase/auth-helpers-nextjs! You can find everything on how to use @supabase/ssr with nextjs here, which is the guide I followed: |
@leonardoparisii Yeah I've been following that guide as well - but for some reason the behavior is different in my project. If I try using the Did you have to do anything beyond that guide? |
Nope, I just fixed it by sticking to the guide: I have this folder structure for the supabase init files: and the auth route for the code param under /app: everything with the same content of the docs, I only added a couple of checks on the protected routes inside of the middleware.ts file, (the one at the /src level). |
@leonardoparisii What version of next are you on? I'm using 14, but have noticed most of the troubleshooting online for this issue is in 13 I think. |
I'm on version 14.2.2. Yeah, you can try downgrading Next and see what happens. Let me know when you find out what the problem is because I'm pretty curious now lmao. |
Hi, I'm experiencing this build error in my application,
To Reproduce
Additional context
middleware.ts
app/api/auth/callback/route.ts
app/utils/supabase.ts
description: "Route /<NAME_ROUTE>couldn't be rendered statically because it used cookies. See more info here: https://nextjs.org/docs/messages/dynamic-server-error",
I'm getting this in every route where I have something like this:
The text was updated successfully, but these errors were encountered: