Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. #54861

Closed
dgozman opened this issue Sep 9, 2024 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@dgozman
Copy link
Contributor

dgozman commented Sep 9, 2024

Version

v22.7.0

Platform

Darwin 22.6.0 Darwin Kernel Version 22.6.0; root:xnu-8796.141.3.706.2~1/RELEASE_ARM64_T6000 arm64

Subsystem

loader

What steps will reproduce the bug?

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

Always reproduces with v22.7.0, does not reproduce with v22.6.0.

Running as node --no-experimental-detect-module main.js does not trigger the assert, and instead shows an expected error message "SyntaxError: Cannot use import statement outside a module".

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

> node main.js
<...>/imported.ts:1
import fs from 'fs';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (node:internal/modules/cjs/loader:1469:18)
    at Module._compile (node:internal/modules/cjs/loader:1491:20)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:125:16)
    at Object.<anonymous> (<...>/main.js:3:1)

Node.js v22.6.0

What do you see instead?

> node main.js
node:internal/assert:14
    throw new ERR_INTERNAL_ASSERTION(message);
    ^

Error [ERR_INTERNAL_ASSERTION]: 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 (node:internal/assert:14:11)
    at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:329:5)
    at new ModuleJobSync (node:internal/modules/esm/module_job:313:34)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:314:11)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
    at Module._compile (node:internal/modules/cjs/loader:1503:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Node.js v22.7.0

Additional information

No response

@aduh95
Copy link
Contributor

aduh95 commented Sep 9, 2024

Duplicate of #54773.

Thanks for the report and the repro, let's continue the discussion over there.

@aduh95 aduh95 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
@RedYetiDev RedYetiDev added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

3 participants