Skip to content

ECMAScript modules requires .mjs extension since 12.0.0 #27407

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

Closed
aabfred opened this issue Apr 25, 2019 · 2 comments
Closed

ECMAScript modules requires .mjs extension since 12.0.0 #27407

aabfred opened this issue Apr 25, 2019 · 2 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features.

Comments

@aabfred
Copy link

aabfred commented Apr 25, 2019

  • Version:v12.0.0
  • Platform:Linux localhost.localdomain 5.0.6-200.fc29.x86_64 deps: update openssl to 1.0.1j #1 SMP Wed Apr 3 15:09:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:ECMAScript Modules

node --experimental-modules --harmony test

On v11.13.0, it runs test/index.mjs
On v12.0.0, it throws "Cannot find module '/XXX/test' imported from /XXX/"

Running node --experimental-modules --harmony test/index fails too.

Running node --experimental-modules --harmony test/index.mjs fails on inner imports.

@devsnek
Copy link
Member

devsnek commented Apr 25, 2019

the modules implementation currently disables extension resolution. you'll need to use --es-module-specifier-resolution=node to get the good behaviour or add the full relative path to the files you're trying to run.

@devsnek devsnek added esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. labels Apr 25, 2019
@bnoordhuis
Copy link
Member

Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features.
Projects
None yet
Development

No branches or pull requests

3 participants