New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic imports started failing in 0.26.0 #2552
Comments
We're also facing a similar issue, as @purepear, especially on CI. I tried to reproduce the issue in isolation, but it seems to be random (which confirms what happens on our CI jobs: we re-run them and they succeed). The only tests that randomly fail are those using |
I also encountered the same issue. Rolling back to 0.25.8 fixes the problem. |
I noticed this in stackblitz, but cannot reproduce locally. Do you also this this locally? |
Hey @sheremet-va, I tested your not yet merged PR and it seems to work fine 🎉 For others having similar problems: after updating I still had to add Re stackblitz:
I just transferred the stackblitz code locally and it runs fine. Seem like an unrelated stackblitz-specific issue. |
Describe the bug
I'm having problems with dynamic imports
npx vitest run individualFile.test.js
)The problem happens when I test multiple test files that have modules which dynamically import other modules:
The problem doesn't happen all the time - sometimes the tests pass, sometimes they fails and it's not always the exact same tests that fail. It feels like there's some sort of race condition between the workers when they start loading dynamic modules.
I made sure to await in all places
Reproduction
It's difficult to put together a reproduction because of the complexity of the project.
Any tips that would help narrow this down are welcome. 🙏
I tried creating a repro but it's still not ready - couldn't reproduce the flaky failures.
However I bumped into an interesting problem which may or may not be related:
npx vitest
npx vitest run
https://stackblitz.com/edit/vitest-dynamic-imports-issues
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: