Skip to content

node --loader for REPL (without entrypoint) does not execute loader #33435

Closed
@cspotcode

Description

@cspotcode
  • Version: 14.2.0
  • Platform: Ubuntu 16.04.6
  • Subsystem: ESM loader hooks, REPL

What steps will reproduce the bug?

cat 'console.log("hooks executing")' > hooks.mjs
node --loader ./hooks.mjs
# At the REPL prompt:
> import("http://example.com/foo")

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 our import() 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions