We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 34941cd + 4d0357e commit 0060dd1Copy full SHA for 0060dd1
1 file changed
src/routes/solid-start/advanced/auth.mdx
@@ -50,9 +50,12 @@ const getPrivatePosts = query(async function() {
50
})
51
52
export default function Page() {
53
- const posts = createAsync(() => getPrivatePosts());
+ const posts = createAsync(() => getPrivatePosts(), { deferStream: true });
54
}
55
```
56
57
Once the user hits this route, the router will attempt to fetch `getPrivatePosts` data.
58
If 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.
0 commit comments