-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Browser mode broken with bundling/transpilation issues under 2.0.0-beta.12 #6023
Comments
@xeger try adding |
Thank you for the quick response. TL;DR you've given me a serviceable workaround and unblocked development. I believe the details will be relevant to letting you solve the issue. Manually adding Reinitializing Applying this workaround to my actual repository (not the minimal repro): fail. The difference in my actual repository is that I've also got Upon install, npm gives me a lot of peer dependency warnings; it seems that Storybook is dragging in It seems that npm's hoisting/resolution of incompatible peer dependencies is yielding a bad tree that breaks vitest, whereas pnpm makes different choices and/or has better isolation which lets vitest run. Even more confusingly, if I try to break my independent-repro repository by adding Long run this problem should disappear for me, as I don't intend to keep using I've pushed some commits to the repro repository showing vitest begin working, then break again, as the dependency tree evolves. Hopefully it'll prove useful to you, but this feels like the sort of thing that should go away over time once you release vitest 2.0 and all of your dependent libraries are upgraded to make use of it. That could take awhile however. You've earned yourself a sponsor today 🖖 . Some DetailsUpon adding vitest:
Upon
|
try adding vitest dependencies also to "resolutions" entry |
That works; thank you. (I am still going to just migrate to pnpm; it brings other benefits.) |
Describe the bug
Preface: thank you for all of your hard work; Browser Mode with the preview provider is the reason I strongly favor vitest for my project. I need the speed of Jest, the runtime inspectability of Cypress or Playwright, and the clean architectural simplicity of vite -- and you are poised to deliver! ❤️
When I write a trivial test for a trivial component and try to run vitest, nothing works. It seems something is going very wrong with module paths on disk and/or contents, as represented in the bundled code which makes it into the browser. Perhaps the test server is being influenced by a bad configuration choice in one of my vite/tsconfig files?
The first telltale happens when I open the runner:
My favored browser (Chrome) opens and happily shows the vitest UI, but my test is stuck in "pending" forever:
Opening the browser console reveals more errors:
Reproduction
I've created a public repository with a minimal reproduction.
Just clone,
npm install
, andnpx vitest
.System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: