Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
To run the reproduction:
pnpm run node-error-repro
. This should run tests and create files with all the output from those tests.What happens:
child_process
in the reproduction, becauseworker_thread
crashes the whole process) crashes while trying to import something. I've addedconsole
logs in our module runner implementation - it only logs the module if it's not cached already. Every time it crashes it imports the same file it looks like (because the end of the debug is always the same in all files -node_modules/loupe/lib/helpers.js
). I don't think that file is the problem, but one of its parents maybe? Usually, it happens at least on the second test run after we create a new executor:vitest/packages/vitest/src/runtime/workers/vm.ts
Line 77 in 0499a31
Vitest never manually clears the cache, we rely on gc, but we also reuse
fileMap
cache:vitest/packages/vitest/src/runtime/workers/vm.ts
Line 15 in 0499a31