nlivyk
nlivyk
SSolidJS
Created by nlivyk on 6/30/2024 in #support
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!
4 replies