sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
6.99k stars 433 forks source link

Run `preload()` on _error route #1649

Open madeleineostoja opened 3 years ago

madeleineostoja commented 3 years ago

Is your feature request related to a problem? Please describe. I'm not sure if this is a bug or a missing feature, because I can't find documentation on it, but it seems that preload() calls aren't run on the _error route. If this is the case, it's a dealbreaker for any site that uses a CMS for 404 page content.

Describe the solution you'd like Run preload() on the _error route, when triggered by a this.error(...) call in another route.

Describe alternatives you've considered The only alternative I can think of is either hardcoding our 404 page, which isn't viable for our editing team, or fetching data clientside, which is pretty janky.

How important is this feature to you? Quite important, it's almost a dealbreaker for using Sapper in client websites going forward. The 404 page is pretty inconsequential, but it's a bad look for us as an agency to not offer editing control of the content on it.