Skip to content

Commit 473894b

Browse files
committed
chore: disable proxy service worker in dev
1 parent eaf6620 commit 473894b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ export default defineNuxtModule<ModuleOptions>({
389389
logger.debug('[nuxt-scripts] First-party config:', { firstPartyEnabled, firstPartyPrivacy, firstPartyCollectPrefix })
390390

391391
// Setup Service Worker for first-party mode (must be before modules:done)
392-
if (firstPartyEnabled) {
392+
// Skip in dev - persistent SW causes issues when switching between dev servers
393+
if (firstPartyEnabled && !nuxt.options.dev) {
393394
// Use root path to avoid conflict with /_scripts/** wildcard route
394395
const swPath = '/_nuxt-scripts-sw.js'
395396
const swRules = getSWInterceptRules(firstPartyCollectPrefix)

0 commit comments

Comments
 (0)