{"id":"e8226c0cd149f26b","repo":"vitest-dev/vitest","slug":"no-projects-were-found-in-relativefile-make","errorCode":null,"errorMessage":"No projects were found in \"${relativeFile}\". Make sure your configuration is correct.","messagePattern":"No projects were found in \"(.+?)\"\\. Make sure your configuration is correct\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/node/projects/resolveProjects.ts","lineNumber":450,"sourceCode":"            [...chain, realConfigFile].map(file => `\"${relative(context.rootConfig.root, file)}\"`).join(' -> '),\n            '. Make sure your configuration is correct.',\n          ].join(''),\n        )\n      }\n      chain = [...chain, realConfigFile]\n      context.containerConfigFiles.push(configFile)\n    }\n\n    const childContext: ProjectsResolutionContext = {\n      ...context,\n      parentViteConfig: entry.viteConfig,\n      parentConfig: entry.projectConfig,\n      ancestors: [...context.ancestors, entry.projectConfig.name],\n      chain,\n    }\n    const children = await resolveDeclaredProjectEntries(childContext, definitions)\n    if (!children.length) {\n      throw new Error(\n        `No projects were found in \"${relativeFile}\". Make sure your configuration is correct.`,\n      )\n    }\n    result.push(...children)\n  }\n  return result\n}\n\nfunction safeRealpath(path: string): string {\n  try {\n    return realpathSync(path)\n  }\n  catch {\n    return path\n  }\n}\n\n// `name` must stay unique per project, `projects` would redefine the whole workspace","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/node/projects/resolveProjects.ts#L432-L468","documentation":"Inside flattenContainerEntries (resolveProjects.ts:449-453), after recursively resolving a container config's projects, if the result is empty Vitest throws naming the container file. Unlike the top-level 286 error, this fires per-container: the container declared projects but none of its children resolved into actual entries.","triggerScenarios":"A container config declares projects: [...] but every child is filtered out, references non-existent files, or itself resolves to nothing; a container's projects array is effectively empty after glob expansion.","commonSituations":"A container wraps a glob like 'packages/*/vitest.config.ts' but no sub-package has that file; all child projects were excluded by a misapplied --project filter scoped to the container; nested container whose children all fail (those would surface as 287).","solutions":["Check that the container's projects array references real, resolvable project files/directories.","Remove the container if it has no real children, or fix the glob to match existing projects.","Ensure the --project filter doesn't exclude every child of this container.","Inspect the container file named in the error to see its projects declaration."],"exampleFix":"// before: container.config.ts\nclass Container { projects = ['packages/*/vitest.config.ts'] } // matches nothing\n\n// after\nclass Container { projects = ['packages/*/vite.config.ts'] } // correct filename pattern","handlingStrategy":"validation","validationCode":"const childCount = await countResolvedProjects(containerProjects)\nif (childCount === 0) throw new Error(`Container '${containerFile}' resolves to zero projects; check its projects array`)","typeGuard":"function nonEmpty<T>(arr: T[]): boolean { return arr.length > 0 }","tryCatchPattern":null,"preventionTips":["Don't declare projects in a container unless children actually exist.","Dry-run the container's globs to confirm matches.","Prefer a flat top-level projects list over deeply nested containers."],"tags":["projects","container","empty-results","configuration"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}