-
-
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
Mistaken ESM as CJS when using svelte #1776
Comments
Duplicate of #1753 |
|
Thank you, @sheremet-va, for the prompt reply! My bad. I presumed too much, because Would you kindly give me some suggestions about how to make it work with vitest? Much obliged. |
Workaround is described in linked issue:
We might disable in in the future by default, seeing that ecosystem still is not ready for ESM. |
Got it. Works now! Thank you so much, @sheremet-va! |
Ah, three days ago... Please do set the default as false. Thanks a lot! 😂 |
Closed as duplicate |
Describe the bug
Although
npm run dev/build
works perfectly,npm run test
throws out an error:After some investigation, the offending code (deep in my dependency chain) turns out to be:
It seems that somehow vitest incorrectly considers a perfect es module (
css-what
) as cjs, thus refusing to import it.However, commenting out
svelte
in vite.config can make the error go away in vitest (and obviously breaks my code):Dependency chain:
My code:
@tiptap/html
:zeed-dom
:Reproduction
https://stackblitz.com/github/andy1li/vitest-bug-report
npm run dev
to see that vite and svelte work fine:npm run test
to reproduce the error msg:System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: