-
Notifications
You must be signed in to change notification settings - Fork 341
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected behaviour
Node is able to run ES modules with cyclic dependencies without issue. I would expect the same when using the the loader-hook.
Actual behaviour
When specifying --loader dd-trace/loader-hook.mjs
, the node process exits early with an exit code 13
Steps to reproduce
Here are a couple modules with a circular dependency, i.e. a imports from b and b imports from a.
Running node a.mjs
works as expected, producing output testB\ntestA
and exiting with code 0.
Running node --loader dd-trace/loader-hook.mjs a.mjs
prints out the standard Custom ESM Loaders warning but then silently exits with code 13 without executing the functions.
a.mjs
import { testB } from './b.mjs';
export function testA() {
console.log("testA");
}
testB();
b.mjs
import { testA } from './a.mjs';
export function testB() {
console.log("testB");
testA();
}
Environment
- Operation system: MacOS 12.6
- Node.js version: v18.17.1
- Tracer version: dd-trace 4.13.1
- Agent version: n/a
- Relevant library versions: n/a
ChrisBellew, vecerek, smartinio and abachman-path
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working