SolidJSS
SolidJSโ€ข2y agoโ€ข
5 replies
nlivyk

Using session causes "Cannot set headers after they are sent to the client"

Hi! I'm facing a weird behavior when trying to use 'useSession' or 'getSession' in a "use server" function. If I clear the cookies on the page, I get the error "Cannot set headers after they are sent to the client".
To reproduce: clone and run https://github.com/livyk/solid-bug (it's a starter with the tailwind template + the sessions example from the docs). Navigate to /users. Clean cookies on the page and you are supposed to get the error.
Am I doing something wrong, or it's a potential bug?
Thanks!
GitHub
Contribute to livyk/solid-bug development by creating an account on GitHub.
GitHub - livyk/solid-bug
Was this page helpful?