-
Notifications
You must be signed in to change notification settings - Fork 32
404 Pages whenever I deploy a new build of my site—HELP! #94
Comments
@kevinmarrec any ideas here? |
Hi @jastaffen , we would need to compare files between deployments I guess, I think it's indeed related to the service worker caching assets, but it's hard to debug. If you disable Service Worker with I think I have many improvements to provide around the default service worker to fix some issues, but my Workbox knowledge is limited, I'll need to dive more into it, along the documentation of this module. If anyone want to have some try on their own regarding custom service worker, there's a |
I think we should find a way to reproduce it locally by running |
Hi @kevinmarrec thank you for your in depth reply! I've come to realize that this issue is probably 2-pronged. One is that vite throws an error when it's unable to find a chunk that used to exist as part of a build and nuxt3 is not seamlessly catching those errors and updating the chunk asset (which is what happened under the hood in nuxt 3 [https://github.com/nuxt/nuxt/issues/14594]. The other probably does have to do with workbox's powerful caching mechanisms. If I were to set pwa.workbox.enabled: false, are you saying that that would break the website or would it unregister the service worker and also mean that the website would no longer be installable on people's local devices? I definitely know less than you about workbox :). I think I'd like to remove it altogether but don't know how to do that and I'm concerned about the implications of doing so (functionality, performance, etc.). |
Setting In other terms, it would make your app not a PWA anymore, and only laverage the metas & icons features. |
Also, it seems https://github.com/nuxt/nuxt/releases/tag/v3.2.2 has an experimental thing related to nuxt/nuxt#14594 you mentioned. You may find more info on related merged PR nuxt/nuxt#19038 notes, in complement of nuxt/nuxt#14594 which has been tagged as resolved. I don't think I can't help more as I think some of the |
Hi @kevinmarrec, yeah when I started this issue, I said that I wasn't sure yet whether it was related to nuxt3 or the PWA. And it turns out that Nuxt3 did not have the same chunk error catch that was baked into nuxt2 whenever a new deployment was made and a server was trying to fetch a cached file that no longer existed, which is now part of it. I'm going to deploy my project with this update tomorrow when I'm at work, and we will see if the error persists. If it does, then I will feel suspicious again of the service worker. Thank you for all your help / explanations on everything here. I will keep you posted. :) |
Hi there, I'm currently using nuxt-pwa-module for a fairly large website I built using nuxt3 and I'm experiencing an issue that I've only been able to see in production via my log drains. I never actually explicitly set pwa.workbox.enabled and I believe it defaults to enabled if that is the case, but I am noticing that whenever I deploy a new version of my site, I am seeing tons of 404s in my log drains for just the build files themselves (i.e. /_nuxt/useTracking.3ab57097.js). Could this be attributed to the service worker? If so, how can I recache or reset it when a new deployment is made? Alternatively, if I wanted to just disabled the service worker entirely, would setting pwa.workbox.enabled to false entirely clear the service worker from users as they navigate to the site? Would there be anything I should be concerned about in the event that I do decide to disable the service worker?
I know this is long winded. Please help if you can ! :)
The text was updated successfully, but these errors were encountered: