Confusing error message when using import
inside CJS file
#56518
Labels
esm
Issues and PRs related to the ECMAScript Modules implementation.
import
inside CJS file
#56518
Version
23.6.0
Platform
Subsystem
esm
What steps will reproduce the bug?
file.cjs
file containingimport "path";
node file.cjs
How often does it reproduce? Is there a required condition?
/
What is the expected behavior? Why is that the expected behavior?
It should tell me that to use
import
inside file I need to use.mjs
and not.cjs
What do you see instead?
It also offers the solution of setting "type": "module" in the package.json, but that is wrong since my file is .cjs.
Additional information
No response
The text was updated successfully, but these errors were encountered: