Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to map Angular stacktrace to sourcemap in script?

I deployed an Angular app with production build. When an error occurs I log it so can I check that the next day. The log shows the error stack in the minified production build:

/main.*****.js:1:7466

As I have no chance to reproduce it in the browser so I cannot use the sourcemaps in the browser. I want to write a script where I can paste this error stack and it finds out where it occurs in the code.

Is this possible and yes, which is the correct approach?

like image 712
Ero Stefano Avatar asked Jul 27 '26 21:07

Ero Stefano


1 Answers

I'm in the same situation and I stumbled upon this npm package: https://www.npmjs.com/package/sourcemapped-stacktrace

I wasn't able to try it out yet but it does seem very fitting.

like image 160
0xLST Avatar answered Jul 30 '26 19:07

0xLST



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!