Skip to content

ERR_UNKNOWN_FILE_EXTENSION is not thrown correctly #27761

@targos

Description

@targos

Reproduction:

echo "import './test.unknown'" > test.mjs
touch test.unknown
node --experimental-modules test.mjs
$ node --experimental-modules test.mjs
(node:15096) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/cjs/loader.js:815
      internalBinding('task_queue').triggerFatalException(
                                    ^

Error [ERR_INTERNAL_ASSERTION]: Code: ERR_UNKNOWN_FILE_EXTENSION; The provided arguments length (2) does not match the required ones (1).
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at assert (internal/assert.js:13:11)
    at getMessage (internal/errors.js:284:3)
    at new NodeError (internal/errors.js:177:23)
    at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:101:13)
    at Loader.resolve (internal/modules/esm/loader.js:70:33)
    at Loader.getModuleJob (internal/modules/esm/loader.js:143:40)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:43:40)
    at link (internal/modules/esm/module_job.js:42:36)

Metadata

Metadata

Assignees

No one assigned

    Labels

    esmIssues and PRs related to the ECMAScript Modules implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions