-
Notifications
You must be signed in to change notification settings - Fork 30k
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
node --loader
for REPL (without entrypoint) does not execute loader
#33435
Comments
@DerekNonGeneric Calling |
That would seem plausible seeing as how it's using the same ESM loader. Since |
To clarify my use-case, I don't care if the REPL has feature parity with ES module context. I expect the REPL to run as CommonJS, though if in the future it runs as ESM, that will also be ok. If I've implemented a loader hook and published it to npm. When people try to use it, and node's loader behavior is confusing or seems to violate node's documentation, then they'll file bug reports with me. I'll redirect them to https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_experimental_loaders, which hopefully will be updated as needed to clarify node's REPL behavior and the caveats with loader hooks. I understand that all of this is experimental. |
Fixes: #33435 PR-URL: #33437 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: #33435 PR-URL: #33437 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: #33435 PR-URL: #33437 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: nodejs#33435 PR-URL: nodejs#33437 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: #33435 PR-URL: #33437 Backport-PR-URL: #35394 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
What steps will reproduce the bug?
The message "hooks executing" is never written to stdout, indicating that
hooks.mjs
is never executed, even though the ESM resolve hook should be invoked to handle ourimport()
call.How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
When launching the node REPL with
--loader
flag, the loader hooks are executed.What do you see instead?
Loader hook file is not executed.
Additional information
The text was updated successfully, but these errors were encountered: