Closed finnbear closed 3 years ago
This was also reported in https://github.com/sveltejs/sapper/issues/1538 and https://github.com/sveltejs/sapper/issues/1441
I'm not quite sure what the best fix is. See the description in https://github.com/sveltejs/sapper/issues/1545#issue-705849178. I'm leaning towards prepending the base path. Though I'm not actively working on Sapper at the moment. But if you'd like to send a PR I'll review it
Those do look like the same issue. I guess we can close this as duplicate.
Describe the bug The paths passed to the service worker for caching do not include the basepath
Logs Here is the compiled service worker for my project, despite the fact that I specified a two-directory-deep base path following the instructions in the documentation. As you can see, many of the paths in the service worker start with /client rather than /my/basepath/client.
To Reproduce
Expected behavior Service worker should be passed paths that conform to the basepath.
The output of
npx envinfo --system --npmPackages svelte,sapper,rollup,webpack --binaries --browsers
System: OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa) CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz Memory: 7.26 GB / 31.31 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 14.13.0 - ~/.nvm/versions/node/v14.13.0/bin/node npm: 6.14.8 - ~/.nvm/versions/node/v14.13.0/bin/npm Browsers: Firefox: 81.0Your browser: Firefox 81
Your hosting environment (i.e. Local, GCP/AWS/Azure, Vercel/Begin, etc...): Simple http server
If it is an exported (
npm run export
) or dynamic application: Exported/staticSeverity My site works fine, but nothing is cached properly by the service worker.