File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/routes/solid-start/advanced Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,12 @@ const getPrivatePosts = query(async function() {
5050})
5151
5252export default function Page() {
53- const posts = createAsync (() => getPrivatePosts ());
53+ const posts = createAsync (() => getPrivatePosts (), { deferStream: true } );
5454}
5555```
5656
5757Once the user hits this route, the router will attempt to fetch ` getPrivatePosts ` data.
5858If the user is not signed in, ` getPrivatePosts ` will throw and the router will redirect to the login page.
59+
60+ To prevent errors when opening the page directly, set ` deferStream: true ` .
61+ This would ensure ` getPrivatePosts ` resolves before the page loads since server-side redirects cannot occur after streaming has started.
You can’t perform that action at this time.
0 commit comments