sveltekit: Fallback file does not exist in injected manifest (for SPA app)
I am currently creating a SPA using Svelte 5, SvelteKit 2 and Vite 6. For the SvelteKitPWA plugin I use the injectManifest strategy and I configured my fallback(for sveltekit adapater static) to be app.html.
When I build my project I see the app.html file correctly in the build folder. However when I inspect the injected data in my service worker the entry for app.html is missing (as a matter of fact not even an app entry is there.
I looked a bit into this plugins code and it seems like you guys are expecting a fallback.html inside the prerender/pages folder (inside .svelte-kit). However that folder does not contain a fallback.html file (nor does it contain an app.html file) the only files it contains are the once from my actual pre-rendered pages.
Not sure if that is some type of recent change in how Vite/SvelteKit works or am I missing some setup?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (17 by maintainers)
I’m going to add
spaoption with a few parameters, in the meantime use the hack.Replace
app.htmlwith/apphere https://github.com/fkrauthan/sveltekit-pwa-issue/pull/1/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddR138 also in the sw here https://github.com/fkrauthan/sveltekit-pwa-issue/blob/master/src/service-worker.ts#L15