{"id":"fb07d81feec8ec2b","repo":"vitest-dev/vitest","slug":"inspectoption-does-not-work-with-browserconfi","errorCode":null,"errorMessage":"${inspectOption} does not work with\n${browserConfig}\n\nUse either:\n${correctExample}\n\n...or disable ${inspectOption}\n","messagePattern":"(.+?) does not work with\n(.+?)\n\nUse either:\n(.+?)\n\n\\.\\.\\.or disable (.+?)\n","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/projects/resolveProjects.ts","lineNumber":741,"sourceCode":"          const coverageExample = `\n{\n  coverage: {\n    provider: 'istanbul',\n  },\n}\n            `.trim()\n\n          throw new Error(\n            `@vitest/coverage-v8 does not work with\\n${browserConfig}\\n`\n            + `\\nUse either:\\n${correctExample}`\n            + `\\n\\n...or change your coverage provider to:\\n${coverageExample}\\n`,\n          )\n        }\n\n        if (globalConfig.inspect || globalConfig.inspectBrk) {\n          const inspectOption = `--inspect${globalConfig.inspectBrk ? '-brk' : ''}`\n\n          throw new Error(\n            `${inspectOption} does not work with\\n${browserConfig}\\n`\n            + `\\nUse either:\\n${correctExample}`\n            + `\\n\\n...or disable ${inspectOption}\\n`,\n          )\n        }\n      }\n\n      if (names.has(name)) {\n        throw new Error(\n          [\n            `Cannot define a nested project for a ${browser} browser. The project name \"${name}\" was already defined. `,\n            'If you have multiple instances for the same browser, make sure to define a custom \"name\". ',\n            'All projects should have unique names. Make sure your configuration is correct.',\n          ].join(''),\n        )\n      }\n      names.add(name)\n","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/projects/resolveProjects.ts#L723-L759","documentation":"Node's --inspect / --inspect-brk debugger attaches via CDP and only works with Chromium-based browser instances. resolveProjects.ts:695-747 rejects a non-chromium (or non-preview-provider) browser instance when globalConfig.inspect or globalConfig.inspectBrk is set, printing the inspect flag, the offending browser config, the correct chromium example, and suggesting you disable inspect.","triggerScenarios":"Running vitest --inspect (or --inspect-brk) while a browser instance is firefox/webkit, or while using a non-chromium browser name under a non-preview provider.","commonSituations":"Debugging a Node-side test with --inspect while browser mode also runs a firefox instance; a global inspect flag in the dev script that hits a multi-browser project.","solutions":["Use a Chromium instance (chromium under playwright, chrome/edge under preview) when debugging with --inspect.","Remove --inspect / --inspect-brk from the vitest invocation if you need non-Chromium browsers in the same run.","Run two separate vitest invocations: one with --inspect on a chromium project, one without for the firefox/webkit project."],"exampleFix":"// before: package.json\n\"scripts\": { \"test\": \"vitest --inspect\" }\n// config: browser.instances includes firefox\n\n// after: scope debugging to a chromium-only run\n\"scripts\": {\n  \"test:debug\": \"vitest --inspect --project=chromium-project\",\n  \"test\": \"vitest\"\n}","handlingStrategy":"validation","validationCode":"if ((globalConfig.inspect || globalConfig.inspectBrk) && instances.some(i => !isChromiumName(provider, i.browser))) {\n  throw new Error('--inspect only works with chromium instances; remove the flag or restrict instances')\n}","typeGuard":"function debugCompatible(provider: string, instances: { browser: string }[]): boolean {\n  return instances.every(i => isChromiumName(provider, i.browser))\n}","tryCatchPattern":null,"preventionTips":["Don't pass --inspect globally when browser instances include non-Chromium engines.","Scope debugging to a single chromium project via --project.","Drop --inspect for cross-browser runs."],"tags":["debugging","inspect","browser","chromium","configuration"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}