-
Notifications
You must be signed in to change notification settings - Fork 354
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: Cannot use cookies.set(...) after the response has been generated #71
Comments
I've seen this too, seems to be inside Supabase API. I think it's only on dev mode (at least I've never seen it on prod, confirmation would be good). We have a PR updating that dependency (coupled to some SSR work). If we don't take that, we should at least bump the dep for this issue. |
am facing this issue too - is there any fix coming soon ? |
I updated deps yesterday. Can you try pull that and see if this is fixed? I couldn't repo this after the update. |
I have just started using the template today, and I'm facing this issue too. |
The reason why this happens is usually somewhat architecturally related. The Reason why this can happen (and why it only happens occasionally): When the session gets refreshed (which is when it expires) and this is done in a context of Svelte were setting cookies is not allowed, then this error will pop up. Then, after refreshing the page, the session will usually be proper resolved in the first point and not appear for some more time until it expires etc. Here's the most recent docs about |
I can try to take that task up as I'll be working on some similiar stuff anyways |
Thanks @activenode ! Note: we also have a PR to move to SSR (but it's held up on another bug in supabase): #63 Sounds related, so let's not double up work unless there's a clean fix for main separate from that. |
Hey, I had exactly the same issue and found a workaround for this - in hooks.server.ts I have added the following:
Once I was waiting to finish al session related it worked - seemes for me like the issue happens during the session check -> it happens prior to all relevant session related actions (supabase etc.) |
i tried the fix above and it broke my login page. the only solution i found was to clear my cookies to get my dev environment working again. |
Related bug on supabase: supabase/auth-helpers#466 |
this seems to be resolved by #135 Let me know if anyone can still repo it. |
Getting this error. Not every time I run
npm run dev
at random times but enough times to report issue.The text was updated successfully, but these errors were encountered: