Replies: 3 comments
-
|
By using doing this cause redirect to always work even in manual URL change visit but since the documentation of the auth does not say anything about this, I won't mark this as answer yet |
Beta Was this translation helpful? Give feedback.
-
|
I think the breaking point is the redirect commenting redirect and navigating between |
Beta Was this translation helpful? Give feedback.
-
|
Adding In your code example, Without deferStream, when you visit the link directly, you have two responses from the server. The initial streamed html, and then data later in a second response. The redirect is done via a 302 Redirect using headers, but headers are already set in the initial response, hence the error message. With deferStream, the server waits until the query finishes before sending anything. No double headers. When you navigate using page links, there is client side navigation and no streaming. Only the data needs to be fetched so only one response. I created an issue for the docs because this is a common problem solidjs/solid-docs#1384 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In SolidStart documentation : https://docs.solidjs.com/solid-start/advanced/auth
I'm creating the project using
npm create solid@latest -- -st basicthis is the code in
about.tsxIf I visit
/aboutfor the first time it will properly redirect to/, clicking on theaboutnavigation will properly navigate back to/but if I manually change the url to/aboutafter being redirected to/it will cause this error in console and fail to redirect.Error: Cannot set headers after they are sent to the clientI don't know if this is intentional or not. I appreciate any answers
Beta Was this translation helpful? Give feedback.
All reactions