简体   繁体   中英

Node.JS + TypeScript how I can track the source code from the stack trace?

As I understand typescript will be transpiled to JavaScript and if something inside of my code will throw an error it will contain the stack trace with line numbers of JavaScript not TypeScript. Is any libraries, plugins exists to solve this problem for production running instance? I know that for web we have map.js files is something the similar exist for node.js?

Run your app using ts-node , not node directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM