In production, when using export const prerender = true and generateSW, SvelteKit's default error page no longer works. Instead, the user is shown the page at /.
Reproduction:
In examples/sveltekit-ts, update package.json to use "@vite-pwa/sveltekit": "^0.2.1"
Run npm i, npm run build, and npm run preview
Visit http://localhost:4173/. This shows +page.svelte as expected.
Visit http://localhost:4173/about. This shows about/+page.svelte as expected.
Visit http://localhost:4173/oops. This shows +page.svelte instead of rendering the default error page.
This issue does not occur in development. When running npm run dev and visiting http://localhost:5173/oops, it shows the default error page.
In production, when using
export const prerender = true
andgenerateSW
, SvelteKit's default error page no longer works. Instead, the user is shown the page at/
.Reproduction:
examples/sveltekit-ts
, updatepackage.json
to use"@vite-pwa/sveltekit": "^0.2.1"
npm i
,npm run build
, andnpm run preview
http://localhost:4173/
. This shows+page.svelte
as expected.http://localhost:4173/about
. This showsabout/+page.svelte
as expected.http://localhost:4173/oops
. This shows+page.svelte
instead of rendering the default error page.This issue does not occur in development. When running
npm run dev
and visitinghttp://localhost:5173/oops
, it shows the default error page.I'm using Node v16.19.0 and npm v8.19.3.