vite-pwa / nuxt

Zero-config PWA Plugin for Nuxt 3
https://vite-pwa-org.netlify.app/frameworks/nuxt
MIT License
454 stars 22 forks source link

Example is missing sw.js/dev-sw.js/dev-sw.js?dev-sw #69

Open danieldanielecki opened 1 year ago

danieldanielecki commented 1 year ago

Based on the logs I receive in my current project

[Vue Router warn]: No match found for location with path "/dev-sw.js?dev-sw"
[Vue Router warn]: No match found for location with path "/dev-sw.js"

and https://github.com/vite-pwa/nuxt/issues/54, https://github.com/vite-pwa/nuxt/issues/57, it'd be very beneficial to have the service worker file in the example. It'd clarify lots of doubts.

lovkyndig commented 1 year ago

Maybe it's a bug in dev-mode. I get rid of the warnings with moving .nuxt/dev-sw-dist-files to the public-folder.

danieldanielecki commented 1 year ago

I'm not finding this file in my .nuxt.

Screenshot 2023-11-15 at 20 12 18
lovkyndig commented 1 year ago

This folder is created on yarn dev or whatever dev you use, but not right away. You will not see the folder popping up before you open the browser:)

I mean; open .nuxt in the File Explorer and the run dev; then you see the dev-sw-dist popping up when you open the browser.

userquin commented 1 year ago

https://github.com/nuxt/cli/issues/188

rogadev commented 10 months ago

This bug was so frustrating that I've decided to uninstall this package. However, removing the package leaves the bug behind. Wondering if anyone has figured out how to remove the problems from this package. This is such a headache.

[Vue Router warn]: No match found for location with path "/dev-sw.js?dev-sw"
[Vue Router warn]: No match found for location with path "/dev-sw.js"
userquin commented 10 months ago

You need to uninstall the sw from the browser and run nuxt prepare (will rebuild the .nuxt folder and remove previous files including the dev-sw.js file).

rogadev commented 10 months ago

It looks like it was actually a browser service worker that kept haunting me. Forgive the broken screenshot (Microsoft Windows problem 🤷‍♂️) but here's what it looks like if anyone finds themselves with the same issue and is unsure how to solve it after uninstalling this package. service worker unregister fix