{"id":"05d42302c542b45d","repo":"vitest-dev/vitest","slug":"vitest-wasn-t-able-to-resolve-any-project-resolv","errorCode":null,"errorMessage":"Vitest wasn't able to resolve any project.${resolved.browser.enabled && !resolved.browser.instances?.length ? ` Please, check that you specified the \"browser.instances\" option.` : ``}","messagePattern":"Vitest wasn't able to resolve any project\\.(.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/core.ts","lineNumber":430,"sourceCode":"    }))\n\n    if (resolved.cliOptions.browser?.enabled) {\n      const browserProjects = this.projects.filter(p => p.config.browser.enabled)\n      if (!browserProjects.length) {\n        throw new Error(`Vitest received --browser flag, but no project had a browser configuration.`)\n      }\n    }\n    if (!this.projects.length) {\n      const filter = toArray(resolved.project).join('\", \"')\n      if (filter) {\n        throw new Error(`No projects matched the filter \"${filter}\".`)\n      }\n      else {\n        let error = `Vitest wasn't able to resolve any project.`\n        if (resolved.browser.enabled && !resolved.browser.instances?.length) {\n          error += ` Please, check that you specified the \"browser.instances\" option.`\n        }\n        throw new Error(error)\n      }\n    }\n\n    if (!this.coreWorkspaceProject) {\n      this.coreWorkspaceProject = TestProject._createBasicProject(this)\n    }\n\n    if (resolved.testNamePattern) {\n      this.configOverride.testNamePattern = resolved.testNamePattern\n    }\n\n    // populate will merge all configs into every project,\n    // we don't want that when just listing tags\n    if (!resolved.listTags) {\n      populateProjectsTags(this.coreWorkspaceProject, this.projects)\n    }\n\n    this.reporters = await createReporters(resolved.reporters, this)","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/core.ts#L412-L448","documentation":"Vitest could not resolve any project at all — the workspace yielded zero projects and no --project filter was set. When browser mode is on but no instances are configured, the message appends a hint about `browser.instances`. core.ts:426-430 throws this generic resolution failure.","triggerScenarios":"Run vitest with no config, a broken workspace file, or `test.browser.enabled: true` without any `browser.instances` (and no default applies).","commonSituations":"Empty or mis-located vitest.workspace.ts; config file not picked up due to wrong path; browser enabled without instances; broken project glob.","solutions":["Ensure a valid vitest.config.ts or vitest.workspace.ts exists at the project root and exports a config.","If browser mode is on, define at least one instance: `browser: { enabled: true, instances: [{ browser: 'chromium' }] }`.","Run `vitest --config <path>` to point Vitest at the config explicitly if it is not at the default location.","Verify your workspace file's glob patterns actually match test directories."],"exampleFix":"// before — browser enabled, no instances\nexport default defineConfig({ test: { browser: { enabled: true } } })\n// after\nexport default defineConfig({ test: { browser: { enabled: true, instances: [{ browser: 'chromium' }] } } })","handlingStrategy":"validation","validationCode":"function assertResolvableConfig(config: any) {\n  if (!config) throw new Error('No vitest config resolved; ensure vitest.config.ts exists.')\n  if (config.browser?.enabled && !(config.browser.instances?.length)) {\n    throw new Error('Browser enabled but no browser.instances defined.')\n  }\n}","typeGuard":"function isConfigResolvable(config: any): boolean {\n  return !!config && (!config.browser?.enabled || (config.browser.instances?.length ?? 0) > 0)\n}","tryCatchPattern":null,"preventionTips":["Keep a valid vitest.config.ts or vitest.workspace.ts at the root.","When enabling browser mode, always define at least one instance.","Use --config explicitly when the config lives elsewhere."],"tags":["workspace","project-resolution","browser","config","startup"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}