-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught (in promise) non-precached-url: non-precached-url :: [{"url":"/"}] #63
Comments
You should prerender at least 1 page, by default workbox will use the entry point (in kit the / or base path). You can try adding the export for prerender in +page.ts |
Doing this removed the error when registering the service worker but created a new issue. When I load the page https://my.website.com/ at the root or event https://my.website.com/home, it loads without any issue When I load a page with a subroute like https://my.website.com/intervention/87776318, svelte tries to load all the .js and .css files from this route url Also, the service worker is well registered, but when I try to go in Chrome -> Inspect -> Application -> Service workers and click on "Push", nothing happens. I added logs in my service-worker.js and trie to see them in Thanks |
@HoekWax you should exclude any dynamic page from sw interception via |
This works, thanks Now I'm setting the strategy as injectManifest so that I can customize the service worker, in order to show push notifications especially. I have Here is what my simplified config looks like
I get the following error when doing a
I try to change the srcDir or the filename, is doesn't change anything. Same thing when changing the "swSrc" value in the injectManifest option. |
@HoekWax pwa kit plugin will use kit sw internal build, if you don't configure kit properly ( serviceWorker: {
register: false,
}, |
I updated my config but still have the same issue Here is my config svelte.config.js
vite.config.ts
|
Can I give you more informations that could help ? |
@HoekWax can you check if there is some service-worker.js in the output build? |
There's not, .svelte-kit/output/client is empty |
It's empty when I use injectManifest, because of |
Can you try removing srcDir and filename from pwa options and the service worker name from files in kit config file? |
Well I found what caused the issue by disabling it, the thing is that it would be nice if they both worked together. The issue is caused by the sentryVitePlugin() plugin that I added right after SvelteKitPWA(). After I wrote this, I tested some other things and came back to the same config as before and now it works. My sentryVitePlugin config wasn't configured well and caused another issue, I fixed it, now everything works !! Thanks you very much for your time, I really appreciate it ! |
Hello,
I know this issue has already been talked about but I still can't figure out how to fix.
The service worker is registered without any issue in development, in production I get this error :
Uncaught (in promise) non-precached-url: non-precached-url :: [{"url":"/"}]
Here is my config
From what I understand on possibility would be to disable cache completely, I don't know how or if it's possible.
A better solution would be to set up a fallback url, have something that is cache for the "/" route.
Can you help on that ?
Thanks
The text was updated successfully, but these errors were encountered: