getappmap / appmap-agent-js

This project is deprecated. Please use https://github.com/getappmap/appmap-node/ to record Node.js applications.
Other
28 stars 8 forks source link

Support ts-node #200

Open lachrist opened 1 year ago

lachrist commented 1 year ago

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.

NB: ts-node-esm works fine atm.