nuxt-modules / partytown

Partytown integration for Nuxt. Run third-party scripts from a web worker.
MIT License
318 stars 8 forks source link

[Question] Error when nuxt/pwa module is used #141

Closed ikasianiuk closed 2 years ago

ikasianiuk commented 2 years ago

Hi and thanks for partytown integration for nuxt!

When I tried to use this module with nuxt2 project (that also has @nuxt/pwa module), sometimes I see 404 error saying that /~partytown/partytown-sandbox-sw.html file couldn't be found. I guess this is because they are both registered at the same root scop, so only one of them is working.

I am a noob at service workers, so I was wandering, maybe you could help to find out how to have both of them? :)

ikasianiuk commented 2 years ago

Never mind, my issue was that I had workbox: { enebled: false } in nuxt.config. So a self-destroying service worker was registered (https://pwa.nuxtjs.org/workbox#enabled) and it also unregistered partytown service worker. Seems like changing setting to workbox: false fixed the issue. Sorry for bothering :)

danielroe commented 2 years ago

No problem at all - glad it was resolved!