{"id":"6a55383271b29f87","repo":"vitest-dev/vitest","slug":"the-test-workspace-option-was-removed-in-vitest","errorCode":null,"errorMessage":"The `test.workspace` option was removed in Vitest 4. Please, migrate to `test.projects` instead. See https://vitest.dev/guide/projects for examples.","messagePattern":"The `test\\.workspace` option was removed in Vitest 4\\. Please, migrate to `test\\.projects` instead\\. See https://vitest\\.dev/guide/projects for examples\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/config/resolveConfig.ts","lineNumber":249,"sourceCode":"    )\n\n    resolved.retry = {\n      ...resolved.retry,\n      condition: undefined,\n    }\n  }\n\n  if (options.pool && typeof options.pool !== 'string') {\n    resolved.pool = options.pool.name\n    resolved.poolRunner = options.pool\n  }\n\n  if ('poolOptions' in resolved) {\n    logger.deprecate('`test.poolOptions` was removed in Vitest 4. All previous `poolOptions` are now top-level options. Please, refer to the migration guide: https://v4.vitest.dev/guide/migration#pool-rework')\n  }\n\n  if ('workspace' in resolved) {\n    throw new Error('The `test.workspace` option was removed in Vitest 4. Please, migrate to `test.projects` instead. See https://vitest.dev/guide/projects for examples.')\n  }\n\n  resolved.pool ??= 'forks'\n\n  resolved.project = toArray(resolved.project)\n  resolved.provide ??= {}\n\n  // shallow copy tags array to avoid mutating user config\n  resolved.tags = [...resolved.tags || []]\n  const definedTags = new Set<string>()\n  resolved.tags.forEach((tag) => {\n    if (!tag.name || typeof tag.name !== 'string') {\n      throw new Error(`Each tag defined in \"test.tags\" must have a \"name\" property, received: ${JSON.stringify(tag)}`)\n    }\n    if (definedTags.has(tag.name)) {\n      throw new Error(`Tag name \"${tag.name}\" is already defined in \"test.tags\". Tag names must be unique.`)\n    }\n    if (/\\s/.test(tag.name)) {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/config/resolveConfig.ts#L231-L267","documentation":"A hard breaking-change error thrown during config resolution when the resolved config still contains a `workspace` key. Vitest 4 removed `test.workspace` in favor of `test.projects` (which supports the same array-of-project-config shape plus globs). The check `'workspace' in resolved` fires unconditionally, so any presence of the old key aborts startup.","triggerScenarios":"Upgrading to Vitest 4 while keeping `test: { workspace: [...] }` in vitest.config (or a workspace file). deepMerge carries the `workspace` key into resolved, and the guard throws with a migration link.","commonSituations":"Major-version upgrade from Vitest 2/3 to 4 without migrating config; shared config presets not yet updated; docs/tutorials still referencing the old `workspace` option.","solutions":["Rename `test.workspace` to `test.projects` in your vitest.config / workspace file.","Follow the migration guide at https://vitest.dev/guide/projects for the projects shape (globs are now supported).","Search the repo (and any imported config presets) for `workspace:` and update all occurrences."],"exampleFix":"// before\nexport default defineConfig({ test: { workspace: ['packages/*'] } })\n// after\nexport default defineConfig({ test: { projects: ['packages/*'] } })","handlingStrategy":"validation","validationCode":"if ('workspace' in config.test) {\n  throw new Error('test.workspace was removed in Vitest 4; use test.projects')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Before upgrading to Vitest 4, grep the repo and config presets for `workspace:` and rename to `projects:`.","Run the official Vitest migration codemod if available.","Update internal docs and onboarding templates that reference test.workspace."],"tags":[],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}