<!-- Thank you for reporting an issue. This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help Please fill in as much of the template below as you're able. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify affected core module name --> * **Version**: 14.2.0 * **Platform**: MacOS * **Subsystem**: ESM ### What steps will reproduce the bug? 1. Create an empty `loader.mjs`: ```js console.log('loader loaded') ``` 2. Create a file `foo.js` to be executed: ```js console.log('foo loaded') ``` 3. Now run `foo.js` with the loader: ```sh node --loader=./empty.mjs foo.js ``` As expected, it will print both `loader loaded` and `foo loaded` 4. Now run `foo.js`, but using `-e`: ```sh node --loader=./empty.mjs -e 'require("./foo.js")' ``` Only `foo loaded` is run, whereas I would expect `loaded loaded` to also be printed. 5. `node --loader=./empty.mjs -e 'import("./foo.js")'` This also prints only `foo loaded`, which means that it's not lazy loading of the loader. ### How often does it reproduce? Is there a required condition? Consistently ### What is the expected behavior? The loader should be loaded even when using `-e`. ### What do you see instead? Loader is not loaded when using `-e`.
Activity
[-]Loader is not loaded when using `-e ...`[/-][+]Loader is not loaded when using "-e ..."[/+]DerekNonGeneric commentedon Jun 17, 2020
Linking #33435 due to the similarity.
avivkeller commentedon Jul 2, 2024
I'm not able to reproduce on the latest version on Node.js. AFAICT loaders are now correctly loaded.