Giter Site home page Giter Site logo

Comments (7)

kevinmarrec avatar kevinmarrec commented on August 23, 2024 1

Setting pwa.workbox.enable: false, starting v0.16.0, will indeed unregister the service worker. Your website won't be broken but would no longer be installable due to lack of service worker which is one of the conditions to fullfil PWA installation checks.

In other terms, it would make your app not a PWA anymore, and only laverage the metas & icons features.

from nuxt-pwa-module.

kevinmarrec avatar kevinmarrec commented on August 23, 2024 1

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 404 you're facing are kind of expected behavior when the user already loaded the page, while a new deployment is made and then he interacts or navigates with old chunks.

from nuxt-pwa-module.

jastaffen avatar jastaffen commented on August 23, 2024 1

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. :)

from nuxt-pwa-module.

jastaffen avatar jastaffen commented on August 23, 2024

@kevinmarrec any ideas here?

from nuxt-pwa-module.

kevinmarrec avatar kevinmarrec commented on August 23, 2024

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 pwa.workbox.enabled: false, your app won't be able to be installable anymore.

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 pwa.workbox.templatePath option mentioned in https://github.com/kevinmarrec/nuxt-pwa-module#configuration.

from nuxt-pwa-module.

kevinmarrec avatar kevinmarrec commented on August 23, 2024

I think we should find a way to reproduce it locally by running nuxi build & nuxi preview to simulate production build on localhost with Service Worker.

from nuxt-pwa-module.

jastaffen avatar jastaffen commented on August 23, 2024

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.).

from nuxt-pwa-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.