SPA + Prerendering: Problem with dynamic routes #10664
-
What I want to achieveI'm trying to make a single page application which is partly prerendered. I want to have only static files after building. The top // ...
// Always show top navigation bar
<TopNav />
{#if building}
// Show loading spinner in prerender
<LoadingSpinner />
{:else}
// Show actual content when executed in browser
<slot />
{/if}
export const prerender = true;
export const ssr = true; The problemThe application I'm developing has a dynamic page for each user. ( But I'm not sure how to configure Svelte to achieve this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thinking about it and doing some research, I came to the conclusion that this is not possible with SvelteKit. Visiting a dynamic route means that the static file server always serves the fallback file. Which means, to modify how the response to the dynamic route looks, I would need to prerender the |
Beta Was this translation helpful? Give feedback.
Thinking about it and doing some research, I came to the conclusion that this is not possible with SvelteKit. Visiting a dynamic route means that the static file server always serves the fallback file. Which means, to modify how the response to the dynamic route looks, I would need to prerender the
TopNav
andLoadingSpinner
component into the fallback file. Which is not possible with SvelteKit right now.