navigateFallback: "/404" causes error in service worker registration
mastercoms opened this issue · 5 comments
mastercoms commented
When /404 route is set for navigate fallback, as suggested on Astro integration docs, service worker fails to load due to error:
bad-precaching-response: The precaching request for 'http://127.0.0.1:4321/404' failed with an HTTP status of 404.
This happens on dev and deployed.
userquin commented
do you have a custom 404 page? https://docs.astro.build/en/basics/astro-pages/#custom-404-error-page
EDIT: you need the 404.html in the output build, otherwise you cannot use it
mastercoms commented
I have a custom page, it has 404.html in output, but it gives 404 response so I think the request fails
userquin commented
can you provide a minimal reproduction (Stackblitz or Githup repo)?
mastercoms commented
Sure, I will try soon
mastercoms commented
I'm going to close this for now since I'm not using an app shell model anymore, and I can't make a reproduction, maybe it was a config error / use case error anyway.