Skip to content

'import()' expressions are not supported yet on Node engine >=14.5.0 #250

Description

@Tzahile

Hello,
I'm using Node 14 and all of my project is managed as a module ("type": "module" in package.json).
Until now, using everywhere imports and exports, I didn't see this error.

Lately I added a dynamic import to some new code like the following:

if(process.env.USE_NEW_CODE) {
  const { RunNewCode } = await import("./controllers/new/code.js");
  RunNewCode();
}

Suddenly I got 'import()' expressions are not supported yet error.

I have ecmaVersion field set to 2021,
and "engines": { "node": ">=14.5.0" }
According to the README of this rule, it should be enough

Node 14 fully supports ESM

Thanks in advance!

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions