vitest-dev/vitest · error · Error
No projects were found in "${relativeFile}". Make sure your
Error message
No projects were found in "${relativeFile}". Make sure your configuration is correct. What it means
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.
Source
Thrown at packages/vitest/src/node/projects/resolveProjects.ts:450
[...chain, realConfigFile].map(file => `"${relative(context.rootConfig.root, file)}"`).join(' -> '),
'. Make sure your configuration is correct.',
].join(''),
)
}
chain = [...chain, realConfigFile]
context.containerConfigFiles.push(configFile)
}
const childContext: ProjectsResolutionContext = {
...context,
parentViteConfig: entry.viteConfig,
parentConfig: entry.projectConfig,
ancestors: [...context.ancestors, entry.projectConfig.name],
chain,
}
const children = await resolveDeclaredProjectEntries(childContext, definitions)
if (!children.length) {
throw new Error(
`No projects were found in "${relativeFile}". Make sure your configuration is correct.`,
)
}
result.push(...children)
}
return result
}
function safeRealpath(path: string): string {
try {
return realpathSync(path)
}
catch {
return path
}
}
// `name` must stay unique per project, `projects` would redefine the whole workspaceView on GitHub (pinned to d568f8ce37)
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.
Example fix
// before: container.config.ts
class Container { projects = ['packages/*/vitest.config.ts'] } // matches nothing
// after
class Container { projects = ['packages/*/vite.config.ts'] } // correct filename pattern Defensive patterns
Strategy: validation
Validate before calling
const childCount = await countResolvedProjects(containerProjects)
if (childCount === 0) throw new Error(`Container '${containerFile}' resolves to zero projects; check its projects array`) Type guard
function nonEmpty<T>(arr: T[]): boolean { return arr.length > 0 } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- No projects were found. Make sure your configuration is corr
- Found a circular "projects" definition: ${[...chain, realCon
- Project name "${name}" is not unique. All projects should ha
- Project name "${name}"${entryFile ? ` from "${entryFile}"` :
- Failed to initialize projects. There were errors during proj
AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03).
Data as JSON: /data/errors/e8226c0cd149f26b.json.
Report an issue: GitHub.