-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
vitest cannot load npm dependency (TypeError: default is not a function) #2120
Comments
Your reproduction doesn't work. Please, create a minimal reproduction that I can actually run. (Exclude all dependencies that are not needed) |
Hello @lukasz-madon. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@sheremet-va Hey, I updated the example. |
It should be a problem with the vuex-shared-moudle dependency, which is a UMD-formatted package, and Vitest requires ESM. |
I don't think there is an easy way to fix this, to be honest. We do try to resolve to import createMutationsSharer from 'vuex-shared-mutations';
createMutationsSharer.default() |
I have the same issue with axios-auth-refresh module. Using |
Updates? Having same issue |
it seems updating the vitest to 0.26+ solves it |
Describe the bug
Basic setup of vitest with vue and parcel fails with
TypeError: default is not a function
. I'm building js with parcel but want to run the tests with vitest. Is there a way to import module likevuex-shared-mutations
? My guess is that libraries need module export with default where parcel resolver is more forgiving. Is there such option?Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-ssxqij?file=test/app.spec.js
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: