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

Loader is not loaded when using "-e ..." #33303

Closed
giltayar opened this issue May 8, 2020 · 2 comments
Closed

Loader is not loaded when using "-e ..." #33303

giltayar opened this issue May 8, 2020 · 2 comments
Labels
esm Issues and PRs related to the ECMAScript Modules implementation.

Comments

@giltayar
Copy link
Contributor

giltayar commented May 8, 2020

  • Version: 14.2.0
  • Platform: MacOS
  • Subsystem: ESM

What steps will reproduce the bug?

  1. Create an empty loader.mjs:
console.log('loader loaded')
  1. Create a file foo.js to be executed:
console.log('foo loaded')
  1. Now run foo.js with the loader:
node --loader=./empty.mjs foo.js

As expected, it will print both loader loaded and foo loaded

  1. Now run foo.js, but using -e:
node --loader=./empty.mjs -e 'require("./foo.js")'

Only foo loaded is run, whereas I would expect loaded loaded to also be printed.

  1. 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.

@giltayar giltayar changed the title Loader is not loaded when using -e ... Loader is not loaded when using "-e ..." May 8, 2020
@DerekNonGeneric
Copy link
Contributor

Linking #33435 due to the similarity.

@targos targos added the esm Issues and PRs related to the ECMAScript Modules implementation. label Dec 27, 2020
@avivkeller
Copy link
Member

I'm not able to reproduce on the latest version on Node.js. AFAICT loaders are now correctly loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

No branches or pull requests

4 participants