-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
v14 regresses #16605: node --experimental-modules does not allow running files without an extension #33259
Comments
@jeffs this is correct - files without an extension are disallowed under "type": "module". I would still like to revert that change personally for the main entry point, but it's a tricky consensus issue. |
This is not strictly a regression though since "type": "module" is new behaviour in terms of its semantics. |
Thanks Guy, but I'm not sure what you mean. "type: "module was already supported in v12, and the behavior has now changed in a backward-incompatible way. That seems like the definition of a regression to me. Am I missing some subtlety of the vocabulary? Are you saying the breakage is deliberate, and therefore not considered a regression by the implementers? Are you aware of any work-around? I'd really like to not have to add a separate platform-specific shell script to wrap every Node program. I'm happy to help with implementation or consensus-building if I can. |
Don't use It's not strictly a regression because modules semantics are experimental and unstable. I would like to see if we can change this still... just summoning the energy for it. |
I see, thanks for explaining. Fair enough: Any feature with "experimental" right in the name is bound to change.
Re. energy: Ping me if I can buy you a coffee or a Red Bull. I agree that this change is bad: It's likely to cause a lot more pain than it avoids. |
D'oh, --input-type throws if and only if (!) the file contains an import statement. Please do let the world know if you discover any work-around. |
Same issue when I've tried also enabling
Should I overwrite also the https://nodejs.org/api/esm.html#esm_code_getformat_code_hook in my loader to return |
@adrian-branescu when adding |
See also nodejs/node#33259 (comment) Fixed by switching to CommonJS modules instead of esnext
@mrsufgi Getting the same exact issue. Did you happen to find a workaround for it? |
See also nodejs/node#33259 (comment) Fixed by switching to CommonJS modules instead of esnext
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Seems pretty reliable.
What is the expected behavior?
Node should interpret a specified file, even if it has no extension.
What do you see instead?
Node throws if the specified file has no extension.
The text was updated successfully, but these errors were encountered: