Skip to content

Show TypeScript line numbers in stack traces #2417

Closed
@tjvantoll

Description

@tjvantoll

Currently stack traces show JavaScript line numbers instead of TypeScript line numbers. This makes debugging difficult, and it’s also a tricky thing for beginners to understand. I’m adding a debugging section to the Getting Started Guide, and I’m having a heck of a time trying to explain how this works to new users.

You can recreate this by starting a new project that uses TypeScript.

tns create Whatever --ng
cd Whatever
tns run ios --emulator --watch

And then doing something silly like this in your TypeScript code.

throw Error("Boom!");

You‘ll see a stack trace that gives line numbers in the compiled JavaScript code, and not the source TypeScript files.

CONSOLE ERROR file:///app/tns_modules/trace/trace.js:160:30: ns-renderer: Error in :0:0 caused by: Boom!

	AppComponent@file:///app/app.component.js:6:20

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions