-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Cant import on node using native ESModules (.mjs) (3.0.6) #3332
Comments
@LinusBorg Sure thing. Do you know any website where I can execute node scripts as esm modules? I couldn't find any. I tried to make it as reproducible as possible. I just don't know any way to give you a link. Sure - I can create a github repo with 2 files. If that helps? |
Already deleted my comment as I didn't read your description carefully enough - I still had you mentioning ts-node etc. on discord in my head. Could reproduce the issue successfully. Pretty dumbfounded though as to what the reason could be. We didn't really change anything about the build process, and the entry file for cjs which has this node docs state:
https://nodejs.org/api/esm.html#esm_import_statements My assumption would be that something in the order of instructions in 3.0.6's Haven't collected much experience with native ESModule support in node, to be honest. |
Oh sorry, didn't see that you deleted the comment. I also couldn't figure out what changed. And yes, I mentioned this on discord yesterday. The issue first occurred for me with my ts-node setup but it is the same with node, too. It is super annoying because my server code just stopped working. I went back to 3.0.5 for now and hope that it can be fixed somehow. Don't want to miss out on all the updates :D. |
I looked into this and it is caused by output change due to bumping Rollup to 2.39.0, which then breaks re-exports static analysis in Node.js, where the static analysis is done by I've created an issue in For now we have to pin Rollup to 2.38. |
Note: we should probably introduce a dedicated Node ESM build and |
Version
3.0.6
Reproduction link
I couldnt figure out a way to make this work with code sandbox or runkit. They don't allow to run node directly.
That's why I added a script below for copy/pasting.
Steps to reproduce
What is expected?
No error
What is actually happening?
This works in vue 3.0.5 but is broken in vue 3.0.6. Not sure what changed.
My node version is 14.13
The text was updated successfully, but these errors were encountered: