This repo can be used as a starting point to add better stack trace support to depd, and eventually express as a whole see: nodejs-depd/issues/39.
- install dependencies,
npm i
. - run the server,
npm run serve
. - hit the route,
/exceptional
, note that the lines in the stack trace do not map back tosrc/index.ts
.
You can reproduce the error discussed in node/issues/29994, by running:
NODE_OPTIONS=--enable-source-maps npm run serve
Here's output that, in my opinion, would be good for us to move towards:
Error: my stack trace stinks
at /Users/bencoe/oss/express-ts-errors/build/src/index.js:14:15
-> /Users/bencoe/oss/express-ts-errors/src/index.ts:19:11
☝️ see how it includes the correct line in the .ts
file, along with the
transpiled line.
There is a userland module called source-map-support, which does work with express.
You can try this out by running:
npm run serve-source-map-suppport
This module does seem to work in conjunction with depd
, you can test this
out by hitting the endpoint /success
(which is "deprecated").
Error: my stack trace stinks
at /Users/bencoe/oss/express-ts-errors/src/index.ts:19:11