-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
NPM modules incorrectly interpreted as CJS #680
Comments
As mentioned in #613 (comment), I have found this to be a cause of #613 (and probably #216 too in some cases). The fix in #692 of adding |
I'm getting some related errors:
The error message suggests to specify https://github.com/uiwjs/react-codemirror/blob/master/themes/abcdef/package.json There is currently no |
As you can see here or here the
package.json
could mislead Node.js into load index.js as ESM which triggers the following error:I cannot provide a reproduction but it happens in Vite when rendering SSR (I know this is not expected). Seems like affects other packages. This snippet also fails in SSR:
React fails to render it because it is a not expected object (we are getting the CJS module instead of the render function. As a workaroung you can use
<CodeMirror.default>
and patch the package.json for the packages you need.The text was updated successfully, but these errors were encountered: