3

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?

2
  • This might bring you into the right direction stackoverflow.com/questions/17493738/… Commented Jun 15, 2020 at 8:38
  • I know about map files but how to use them for production stack-trace? Commented Jun 15, 2020 at 9:11

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

If you're using nodejs >= v.12.0.0 add the --enable-source-maps flag (official doc) when executing node. If nodejs version is lower you can use this library or ts-node as mentioned above.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.