-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Option to prerender 404 page #10007
Copy link
Copy link
Open
Labels
feature / enhancementNew feature or requestNew feature or requestp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Milestone
Metadata
Metadata
Assignees
Labels
feature / enhancementNew feature or requestNew feature or requestp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Describe the problem
I am using the static adapter. The recommended way to generate a 404 page seems to be by using the
fallbackoption, however, this option is meant to be used to generate a SPA, so it outputs a blank HTML page. I would like my 404 page to be prerendered.Describe the proposed solution
I propose adding an option to adapter-static to generate a prerendered 404 page.
Alternatives considered
I tried simply creating
404/+page.svelte. There are two problems with this approach:+error.svelte.Problem 1 can be solved by turning the 404 page into a component and rendering it in both
404/+page.svelteand+error.svelte.Problem 2 can be solved by setting
kit.paths.relativetofalse.This feels quite hacky though.
Importance
nice to have
Additional Information
No response