{"record":{"id":"2c7721ee29728ebc","repo":"vitest-dev/vitest","slug":"you-cannot-use-inspectoption-without-no-file","errorCode":null,"errorMessage":"You cannot use ${inspectOption} without \"--no-file-parallelism\"","messagePattern":"You cannot use (.+?) without \"--no-file-parallelism\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/config/resolveConfig.ts","lineNumber":410,"sourceCode":"\n  const fileParallelism = options.fileParallelism ?? browserFileParallelism ?? true\n\n  if (!fileParallelism) {\n    // ignore user config, parallelism cannot be implemented without limiting workers\n    resolved.maxWorkers = 1\n  }\n\n  if (resolved.maxConcurrency === 0) {\n    logger.console.warn(\n      c.yellow(`The option \"maxConcurrency\" cannot be set to 0. Using default value ${configDefaults.maxConcurrency} instead.`),\n    )\n    resolved.maxConcurrency = configDefaults.maxConcurrency\n  }\n\n  if (resolved.inspect || resolved.inspectBrk) {\n    if (resolved.maxWorkers !== 1) {\n      const inspectOption = `--inspect${resolved.inspectBrk ? '-brk' : ''}`\n      throw new Error(\n        `You cannot use ${inspectOption} without \"--no-file-parallelism\"`,\n      )\n    }\n  }\n\n  resolved.browser ??= {} as any\n  const browser = resolved.browser\n\n  if (browser.enabled) {\n    const instances = browser.instances\n    if (!browser.instances) {\n      browser.instances = []\n    }\n\n    // The whole project shares a single browser Vite server, so every instance\n    // must use the same provider. Validate that here and hoist the provider to\n    // the project level so the cluster resolves one even when it is only set per\n    // instance (e.g. connect mode). Because the provider is uniform, any","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/config/resolveConfig.ts#L392-L428","documentation":"The Node inspector (`--inspect` / `--inspect-brk`) attaches to a single process to allow stepping through test code. With file parallelism, tests run across multiple workers/processes and the inspector cannot meaningfully attach. Vitest requires `maxWorkers === 1` (i.e. `--no-file-parallelism` or `--maxWorkers 1`) when inspecting.","triggerScenarios":"Running `vitest --inspect-brk` while `fileParallelism` is true or `maxWorkers` is unset (defaults to >1), or setting both `inspectBrk: true` and a multi-worker pool.","commonSituations":"Forgetting to disable parallelism when debugging; a CI config that always pins workers clashing with a local debug flag.","solutions":["Add `--no-file-parallelism` (or `--maxWorkers 1`) alongside `--inspect`/`--inspect-brk`.","Set `fileParallelism: false` in the debug-only config preset.","Use a dedicated `test:debug` script that bundles both flags."],"exampleFix":"# before\nvitest --inspect-brk\n# after\nvitest --inspect-brk --no-file-parallelism","handlingStrategy":"validation","validationCode":"const inspect = process.argv.some(a => a.startsWith('--inspect'))\nif (inspect && !process.argv.includes('--no-file-parallelism')) {\n  console.warn('Auto-adding --no-file-parallelism because --inspect was passed.')\n  process.argv.push('--no-file-parallelism')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide a `test:debug` npm script that bundles `--inspect-brk --no-file-parallelism`.","In config, only set `inspectBrk` alongside `maxWorkers: 1`."],"tags":["cli","inspect","debug","parallelism"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}