-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
Description
Describe the bug
vitest/packages/coverage-istanbul/src/provider.ts
Lines 235 to 245 in 229b5b3
| private invalidateTree(node: Vite.EnvironmentModuleNode, moduleGraph: Vite.EnvironmentModuleGraph, seen: Set<Vite.EnvironmentModuleNode>) { | |
| if (seen.has(node)) { | |
| return | |
| } | |
| if (node.id && !this.transformedModuleIds.has(node.id)) { | |
| moduleGraph.invalidateModule(node, seen) | |
| } | |
| node.importedModules.forEach((mod) => { | |
| this.invalidateTree(mod, moduleGraph, seen) | |
| }) | |
| } |
An infinite loop caused by circular dependencies in this function.
Reproduction
- prepare circular deps for test
- in vscode vitest extension, run the test with coverage
- rerun the test with coverage
- throw an error "Failed to enable coverage. Maximum call stack size exceeded. Check the output for more details."
Screen.Recording.2025-11-24.at.22.25.42.mp4
System Info
- vitest: 4.0.13
- @vitest/coverage-istanbul: 4.0.13Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable