{"record":{"id":"b6ab33988cbd7b38","repo":"quasarframework/quasar","slug":"workbox-strategy-cfg-pwa-workboxmode-is-inval","errorCode":null,"errorMessage":"Workbox strategy \"${cfg.pwa.workboxMode}\" is invalid. Valid quasar.config file > pwa > workboxMode options are: GenerateSW or InjectManifest. Please fix it.","messagePattern":"Workbox strategy \"(.+?)\" is invalid\\. Valid quasar\\.config file > pwa > workboxMode options are: GenerateSW or InjectManifest\\. Please fix it\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app-vite/lib/quasar-config-file.js","lineNumber":1486,"sourceCode":"      cfg.pwa = merge(\n        {\n          workboxMode: 'GenerateSW',\n          injectPWAMetaTags: true,\n          swFilename: 'sw.js', // should be .js (as it's the distribution file, not the input file)\n          manifestFilename: 'manifest.json',\n          useCredentialsForManifestTag: false\n        },\n        cfg.pwa\n      )\n\n      if (!['GenerateSW', 'InjectManifest'].includes(cfg.pwa.workboxMode)) {\n        const msg =\n          `Workbox strategy \"${cfg.pwa.workboxMode}\" is invalid. ` +\n          'Valid quasar.config file > pwa > workboxMode options are: GenerateSW or InjectManifest.'\n\n        if (this.#shouldFail) fatal(msg, 'FAIL')\n\n        warn(msg + ' Please fix it.\\n')\n        return\n      }\n\n      cfg.build.define['import.meta.env.QUASAR_SERVICE_WORKER_FILE'] =\n        `\"${cfg.build.publicPath}${cfg.pwa.swFilename}\"`\n\n      cfg.metaConf.pwaManifestFile = appPaths.resolve.app(\n        cfg.sourceFiles.pwaManifestFile\n      )\n\n      cfg.sourceFiles.pwaServiceWorker = appPaths.resolve.app(\n        cfg.sourceFiles.pwaServiceWorker\n      )\n    } else if (this.#ctx.mode.bex) {\n      cfg.metaConf.bexManifestFile = appPaths.resolve.app(\n        cfg.sourceFiles.bexManifestFile\n      )\n    }","sourceCodeStart":1468,"sourceCodeEnd":1504,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/quasar-config-file.js#L1468-L1504","documentation":"During #computeConfig, the pwa.workboxMode value is checked against the two valid Workbox strategies: GenerateSW and InjectManifest. An invalid value is a fatal error in strict contexts (#shouldFail) and otherwise a warning that aborts the PWA service-worker configuration step.","triggerScenarios":"quasar dev/build -m pwa with quasar.config > pwa > workboxMode set to anything other than 'GenerateSW' or 'InjectManifest' (typo, wrong casing like 'generatesw', or a stale value from older Quasar versions).","commonSituations":"Migrating from older Quasar CLI versions where other modes existed, copy-pasting config from outdated tutorials, or accidentally writing 'inject-manifest'.","solutions":["Set pwa.workboxMode to exactly 'GenerateSW' or 'InjectManifest' in quasar.config.","If you don't need a custom service worker, use 'GenerateSW'.","If you maintain src-pwa/custom-service-worker.js, use 'InjectManifest'."],"exampleFix":"// before (quasar.config)\npwa: { workboxMode: 'injectManifest' }\n// after\npwa: { workboxMode: 'InjectManifest' }","handlingStrategy":"validation","validationCode":"const modes = ['GenerateSW', 'InjectManifest']\nconst mode = cfg.pwa?.workboxMode\nif (mode !== undefined && !modes.includes(mode)) {\n  throw new Error(`pwa.workboxMode must be one of ${modes.join(' | ')}, got: ${mode}`)\n}","typeGuard":"function isValidWorkboxMode(v) {\n  return v === 'GenerateSW' || v === 'InjectManifest'\n}","tryCatchPattern":null,"preventionTips":["Only copy workboxMode values from current Quasar docs, not old tutorials.","Use exact casing: GenerateSW or InjectManifest.","If not using a custom service worker, omit workboxMode (default GenerateSW)."],"tags":["config","pwa","service-worker","workbox"],"backgroundTag":"invalid-config-enum-value","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}