{"record":{"id":"1fc15837fd92680d","repo":"vitest-dev/vitest","slug":"the-browser-configuration-must-have-a-name-prope","errorCode":null,"errorMessage":"The browser configuration must have a \"name\" property. This is a bug in Vitest. Please, open a new issue with reproduction","messagePattern":"The browser configuration must have a \"name\" property\\. This is a bug in Vitest\\. Please, open a new issue with reproduction","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/projects/resolveProjects.ts","lineNumber":882,"sourceCode":"    }\n\n    // Keep the parent in the entry list as `hidden` so a `TestProject` is\n    // created (instances link to it via `_parent` for the browser provider).\n    // The parent's name is removed from `names` because the instance names\n    // take its place in the user-facing project list.\n    names.delete(parentName)\n    result.push({ ...entry, hidden: true })\n\n    filteredInstances.forEach((instance, index) => {\n      const browser = instance.browser\n      if (!browser) {\n        const nth = index + 1\n        const ending = nth === 2 ? 'nd' : nth === 3 ? 'rd' : 'th'\n        throw new Error(`The browser configuration must have a \"browser\" property. The ${nth}${ending} item in \"browser.instances\" doesn't have it. Make sure your${projectConfig.name ? ` \"${projectConfig.name}\"` : ''} configuration is correct.`)\n      }\n      const name = instance.name\n      if (name == null) {\n        throw new Error(`The browser configuration must have a \"name\" property. This is a bug in Vitest. Please, open a new issue with reproduction`)\n      }\n      if (instance.provider?.name != null && projectConfig.browser.provider?.name != null && instance.provider?.name !== projectConfig.browser.provider?.name) {\n        throw new Error(`The instance cannot have a different provider from its parent. The \"${name}\" instance specifies \"${instance.provider?.name}\" provider, but its parent has a \"${projectConfig.browser.provider?.name}\" provider.`)\n      }\n\n      const provider = instance.provider?.name ?? projectConfig.browser.provider?.name ?? 'preview'\n\n      // Browser-mode CDP only features:\n      if (provider === 'preview' || !isChromiumName(provider, browser)) {\n        const browserConfig = `\n{\n  browser: {\n    provider: ${provider}(),\n    instances: [\n      ${(filteredInstances || []).map(i => `{ browser: '${i.browser}' }`).join(',\\n      ')}\n    ],\n  },\n}","sourceCodeStart":864,"sourceCodeEnd":900,"githubUrl":"https://github.com/vitest-dev/vitest/blob/1fa9837ec26533512fdcad8baebf249771bd340a/packages/vitest/src/node/projects/resolveProjects.ts#L864-L900","documentation":"An internal invariant: after confirming instance.browser exists, Vitest reads instance.name. The name is assigned by Vitest during config normalization, so a missing/null name means normalization did not run correctly. The message explicitly says this is a bug in Vitest.","triggerScenarios":"instance.name is null/undefined during instance expansion, which should not happen because Vitest derives names earlier in the pipeline.","commonSituations":"A broken/partial Vitest build, version skew between config normalization and resolution code, or a custom code path that constructs raw browser instance objects bypassing normalization.","solutions":["Reinstall and rebuild Vitest to rule out a stale build.","Ensure a single Vitest version across the workspace.","Avoid manually constructing browser instance objects; declare them via config only.","If reproducible with standard config, file a Vitest issue with the reproduction."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const instanceHasName = (inst: unknown): inst is { name: string; browser: string } =>\n  typeof inst === 'object' && inst !== null && typeof (inst as any).name === 'string' && typeof (inst as any).browser === 'string'","tryCatchPattern":"try {\n  await resolveProjects(...)\n} catch (err) {\n  if (err instanceof Error && err.message.includes('\"name\" property. This is a bug in Vitest')) {\n  // rebuild/reinstall Vitest; report if reproducible\n  throw new Error('Vitest failed to normalize browser instance names; rebuild and retry', { cause: err })\n  }\n  throw err\n}","preventionTips":["Always declare instances via config (let Vitest normalize names).","Keep a single Vitest version; rebuild after source edits.","Do not hand-construct raw instance objects."],"tags":["internal-bug","browser","instances","config"],"backgroundTag":null,"analyzedSha":"1fa9837ec26533512fdcad8baebf249771bd340a","analyzedAt":"2026-08-11T16:11:39.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}