You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _headers and _redirects files specific to the Cloudflare Pages adapter are not served by CF Pages as static assets. However, because they are placed in the static folder, they are included by default in the files array export from $service-worker.
If a service-worker implementation attempts to add these files to the Cache, without filtering them out in the service-worker or svelte config, it can cause service-worker registration to fail.
This is only a minor annoyance and not blocking, as the files can easily be filtered out.
Browser logs:
(3) ['/_headers', '/favicon.png', '/robots.txt']
service-worker.js:1 the static _headers or _redirects was included in the files array, and needs to be filtered out before we call cache.addAll
service-worker.js:1 Uncaught (in promise) TypeError: Failed to execute 'addAll' on 'Cache': Request failed
Describe the bug
The _headers and _redirects files specific to the Cloudflare Pages adapter are not served by CF Pages as static assets. However, because they are placed in the static folder, they are included by default in the files array export from $service-worker.
If a service-worker implementation attempts to add these files to the Cache, without filtering them out in the service-worker or svelte config, it can cause service-worker registration to fail.
This is only a minor annoyance and not blocking, as the files can easily be filtered out.
Reproduction
Repo: https://github.com/stevengibbsonline/sk/tree/sw-files
Example CF Pages deployment: https://sw-files.sk-dj5.pages.dev/
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: