Skip to content

ECMAScript modules requires .mjs extension since 12.0.0 #27407

Description

@aabfred
  • 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.

Activity

  1. devsnek commented on Apr 25, 2019

    @devsnek
    Member

    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.

  2. added
    esmIssues and PRs related to the ECMAScript Modules implementation.
    experimentalIssues and PRs related to experimental features.
    on Apr 25, 2019
  3. bnoordhuis commented on Apr 28, 2019

    @bnoordhuis
    Member

    Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions