Next.js Discord

Discord Forum

Cookies can only be modified in a Server Action or Route Handler - but only when deployed

Unanswered
Atlantic salmon posted this in #help-forum
Open in Discord
Atlantic salmonOP
Hi there,
I've got a weird issue with the error in the title above. I read through the link that is provided within the error message. I'm using supabase supabase auth and created a session provider-component.

The SessionProvider is the following: https://github.com/TheLexoPlexx/senator/blob/dev/components/user/sessionProvider.tsx
and I am using the "supabase_server"-function imported in there. Everything is server side up to the actual ContextProvider embedded in this component.
The supaase_server-function is the only function in the entire app where the questionable function is called, and it's server side. Of course, the function itself is called multiple times.

I do not get this error locally, but when deployed: https://hastebin.com/share/ilopasurod.json

2 Replies

Atlantic salmonOP
As it turns out, the problem is not reproducable on my work laptop so I guess I need to clear the cache once I am at home again.
Atlantic salmonOP
Okay it "wasn't" a problem on the work computer. Definitely something something cache.