Skip to content

Combine ERR_REQUIRE_ESM with warning #30599

Description

@guybedford

Now that modules are unflagged, the warning for ERR_REQUIRE_ESM when loading a .js file that would be interpreted as a module is being thrown along with the warning message in https://github.com/nodejs/node/blob/master/lib/internal/modules/cjs/loader.js#L1193.

This hinders approaches that want to use this error to explicitly check for support.

Ideally the warning can just be combined with the error message.

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

    esmIssues and PRs related to the ECMAScript Modules implementation.good first issueIssues that are suitable for first-time contributors.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions