-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
When upgrading from 1.4.0 to 1.5.0, an error related to CommonJS modules appears. #5555
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
Comments
Can you provide smaller reproduction? With that size of repo and without English, we cannot take any actions on your issues. |
Hello @rayhomie. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with |
https://github.com/rayhomie/vitest-bug-report clone this repo, and read README.md |
This error is probably due to this change: To get the previous behavior, can you try {
test: {
server: {
deps: {
inline: [/functional-mini/],
},
}
}
} The underlying issue seems to be that you package re-exports preact somewhere, but the way it's done doesn't seems to be NodeJS esm compliant. // node repro.mjs
import { alipayComponent } from 'functional-mini/component';
console.log(alipayComponent);
|
Describe the bug
FAIL tests/alipay/_util/tests/useHandleCustomEvent.spec.ts [ tests/alipay/_util/tests/useHandleCustomEvent.spec.ts ]
SyntaxError: Named export 'render' not found. The requested module './node_modules/preact-render-to-string/dist/index.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from './node_modules/preact-render-to-string/dist/index.js';
const { render: serverRender } = pkg;
Reproduction
https://github.com/ant-design/ant-design-mini/actions/runs/8686918943/job/23819371194
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: