Currently npx appmap-agent-js -- npx ts-node main.ts does not work. This is because we use --loader which changes the default loader from esm to cjs. This is important for the entry point. Normally we always tag the first module loaded as commonjs. But when using ts-node the first module loaded is ts-node entry point. They are doing a hack to make it look like the provided argument is the entry point https://github.com/TypeStrong/ts-node/blob/fd438213ad3b3e1bcabea48627255b8be74c1c24/src/bin.ts#L643. But we are not able to detect that.
Currently
npx appmap-agent-js -- npx ts-node main.ts
does not work. This is because we use--loader
which changes the default loader fromesm
tocjs
. This is important for the entry point. Normally we always tag the first module loaded ascommonjs
. But when usingts-node
the first module loaded ists-node
entry point. They are doing a hack to make it look like the provided argument is the entry point https://github.com/TypeStrong/ts-node/blob/fd438213ad3b3e1bcabea48627255b8be74c1c24/src/bin.ts#L643. But we are not able to detect that.NB:
ts-node-esm
works fine atm.