Skip to content
Discussion options

You must be logged in to vote

Prerendered pages compute the page contents (runnning load functions) at build time, so you have to fetch the user data client-side after the page is mounted.

If you want to fetch data before the page is mounted (load functions), you should not prerender the page.

More info here: https://kit.svelte.dev/docs/page-options#prerender-when-not-to-prerender

Not all pages are suitable for prerendering. Any content that is prerendered will be seen by all users. You can of course fetch personalized data in onMount in a prerendered page, but this may result in a poorer user experience since it will involve blank initial content or loading indicators.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bobbymannino
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants