Closed as not planned
Description
Version
v21.4.0
Platform
Linux codespaces-8a914d 6.2.0-1016-azure #16~22.04.1-Ubuntu SMP Tue Oct 10 17:11:51 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
- npm init -y
- npm add esm
- create a file
test.js
with the following content
import { writeFileSync } from "fs";
console.log("hello");
- node -r esm test.js
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
same as in v21.3.0
/workspaces/working/mocha/esm-test $ nvm use v21.3.0
Now using node v21.3.0 (npm v10.2.4)
/workspaces/working/mocha/esm-test $ node -r esm test.js
hello
What do you see instead?
content of esm.js
is dumped to console for a TypeError
TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
at node:internal/main/run_main_module:28:49
Node.js v21.4.0
Additional information
No response