-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support named export in a CommonJS module in node_modules #4745
Comments
This is expected behaviour, this is how Node.js works. To bypass this, you can use |
I see. I did a quick trial. Seems adding Error log:
|
You need to add a dependency that imports export default {
test: {
server: {
deps: {
inline: ['foo']
}
}
}
} |
It works with the config you provided. Thanks so much. May I have one more last question if you don't mind 😅 ? Why it failed with error about |
|
Clear and concise description of the problem
Please don't mind me creating this issue from a discussion #1360 to keep on track.
Reproduction
https://github.com/Jinjiang/reproductions/tree/vitest-apollo-20231214
The package in my case is
@apollo/client
. In source codeimport { ... } from ...
works. However, when it's written in a file insidenode_modules
, it doesn't work unless using theimport pkg ...
statement.Suggested solution
Support named export in CJS package like
@apollo/client
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: