-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Description
Describe the problem
I am using the static adapter. The recommended way to generate a 404 page seems to be by using the fallback
option, 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:
- It doesn't work during development, because the server renders
+error.svelte
. - It doesn't work when serving the file from a subdirectory, because SvelteKit uses relative paths to assets.
Problem 1 can be solved by turning the 404 page into a component and rendering it in both 404/+page.svelte
and +error.svelte
.
Problem 2 can be solved by setting kit.paths.relative
to false
.
This feels quite hacky though.
Importance
nice to have
Additional Information
No response
Erouax, ryou90, nisarhassan12, joshdales, vaperion and 10 more
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.