nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

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

Open danieldanielecki opened this issue 9 months ago • 7 comments

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.

danieldanielecki avatar Sep 26 '23 18:09 danieldanielecki

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.

lovkyndig avatar Nov 15 '23 04:11 lovkyndig

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

Screenshot 2023-11-15 at 20 12 18

danieldanielecki avatar Nov 15 '23 19:11 danieldanielecki

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.

lovkyndig avatar Nov 15 '23 20:11 lovkyndig

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

userquin avatar Nov 15 '23 20:11 userquin

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"

rogadev avatar Jan 19 '24 14:01 rogadev

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

userquin avatar Jan 19 '24 15:01 userquin

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

rogadev avatar Jan 19 '24 15:01 rogadev