You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux wmertens-nixos 5.15.3-zen1 #1-NixOS ZEN SMP Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
Subsystem
repl
What steps will reproduce the bug?
set type: "module" in package.json, and then try to run node -r ./some-module.js. It will fail with the error
[Error [ERR_REQUIRE_ESM]: require() of ES Module .../some-module.js not supported.
Instead change the require of repl.js in null to a dynamic import() which is available in all CommonJS modules.] {
code: 'ERR_REQUIRE_ESM'
I suppose that when using -r in an ESM repo, the repl must use await import instead of require for -r arguments?
How often does it reproduce? Is there a required condition?
every time when the project is ESM and you try to load a local file as a module
What is the expected behavior?
it works
What do you see instead?
'ERR_REQUIRE_ESM'
Additional information
No response
The text was updated successfully, but these errors were encountered:
Version
16.14.2
Platform
Linux wmertens-nixos 5.15.3-zen1 #1-NixOS ZEN SMP Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
Subsystem
repl
What steps will reproduce the bug?
set
type: "module"
in package.json, and then try to runnode -r ./some-module.js
. It will fail with the errorI suppose that when using -r in an ESM repo, the repl must use
await import
instead ofrequire
for-r
arguments?How often does it reproduce? Is there a required condition?
every time when the project is ESM and you try to load a local file as a module
What is the expected behavior?
it works
What do you see instead?
'ERR_REQUIRE_ESM'
Additional information
No response
The text was updated successfully, but these errors were encountered: