Tom
Tom

Reputation: 5121

How can I make the errors shown in the console refer to the typescript source maps in an angular cli project?

I have just issued the ng new exampleProject command. When an error appears in the console, the stacktrace shows only .js files: not the .ts files. How can I change this?

Here is an example of such an error:

angular error

Upvotes: 1

Views: 1714

Answers (2)

M.Sanjay
M.Sanjay

Reputation: 51

console.trace()

The above code helps to get the complete trace of where the error has occurred in angular including the line number, component name and the function name.

Upvotes: 3

RKG
RKG

Reputation: 612

Add "sourceMap": true, in compilerOptions in your tsconfig.json

Upvotes: 0

Related Questions