Skip to content

ERR_INTERNAL_ASSERTION with require(esm) #55500

@nicolo-ribaudo

Description

@nicolo-ribaudo

Version

23.0.0

Platform

Darwin Nics-MacBook-Air.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:16:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8112 arm64

Subsystem

No response

What steps will reproduce the bug?

EDIT: See in #55500 (comment) for a minimal reproduction

How often does it reproduce? Is there a required condition?

I don't have a minimal reproduction

What is the expected behavior? Why is that the expected behavior?

To not tell me to open a bug report :P

What do you see instead?

(node:69972) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/assert:11
    throw new ERR_INTERNAL_ASSERTION(message);
          ^

Error [ERR_INTERNAL_ASSERTION]: [BABEL]: A require()-d module that is imported again must be evaluated. Status = 2
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
 (While processing: /Users/nic/Documents/dev/github.com/babel/babel/packages/babel-core/test/fixtures/async/plugin-mjs-tla-native/plugin.js)
    at assert (node:internal/assert:11:11)
    at ModuleJobSync.run (node:internal/modules/esm/module_job:358:5)
    at onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:42)
    at async loadMjsFromPath (file:///Users/nic/Documents/dev/github.com/babel/babel/packages/babel-core/lib/config/files/module-types.js:45:12) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Additional information

I don't think I'm using Node.js internals.

cc @joyeecheung

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.esmIssues and PRs related to the ECMAScript Modules implementation.loadersIssues and PRs related to ES module loaders

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions