jkup / ama

Ask me anything!
23 stars 3 forks source link

Prettify Production App Code #16

Open JSsquare opened 6 years ago

JSsquare commented 6 years ago

Hey Jon, Let me introduce myself. I am Johnny was watching your videos on Chrome Dev Tools, really interesting. Had a question I thought I will run through

You had mentioned pretty print button do not help if code is uglyfied, what is the best option to debug if the issue happens only on production code. Just trying to know your thoughts on that

jkup commented 6 years ago

Hi @JohnnyPanikulam!

I think you have a few options for production-only issues. Sometimes pretty printing + a debugger will at least be enough to get you started tracking down the issue. For example if the error you see is on a minified variable but in an area of the code you recognize, that may well be enough.

Second you can try either enabling source maps in production temporarily or using an error catching service like Sentry or New Relic that allows you to upload source maps so that way you can see what code is actually being executed.