nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.64k stars 29.62k forks source link

v18.x ERR_INTERNAL_ASSERTION #55692

Open k1r0s opened 5 days ago

k1r0s commented 5 days ago

Version

v18.20.4

Platform

Linux zigor-schenkervia15pro 6.8.0-47-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct  2 16:16:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

create a javascript file. Create a symbolic link run it

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

consistently, evertime

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

node works as expected

What do you see instead?

an error

node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_INTERNAL_ASSERTION]: Code: ERR_MODULE_NOT_FOUND; The provided arguments length (2) does not match the required ones (3).
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 new NodeError (node:internal/errors:405:5)
    at assert (node:internal/assert:14:11)
    at getMessage (node:internal/errors:451:5)
    at new NodeError (node:internal/errors:379:21)
    at legacyMainResolve (node:internal/modules/esm/resolve:218:9)
    at packageResolve (node:internal/modules/esm/resolve:903:14)
    at moduleResolve (node:internal/modules/esm/resolve:973:20)
    at defaultResolve (node:internal/modules/esm/resolve:1206:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Node.js v18.20.4

Additional information

No response

juanarbol commented 5 days ago

Do you have a code snippet that we can rely on?

RedYetiDev commented 5 days ago

The failing error doesn't provide enough arguments: https://github.com/nodejs/node/blob/v18.20.4/lib/internal/modules/esm/resolve.js#L218

Hamza12700 commented 4 days ago

In node version v23.1 it works fine

aduh95 commented 4 days ago

I cannot reproduce:

$ node --version
v18.20.4
$ ln -s "$PWD/test/fixtures/empty.cjs" ./entry.js
$ node entry.js
$ echo $?
0

It looks like there's some other requirements for the issue to reproduce, which we would need to figure out so the issue can be investigated.