-4

I've searched all other questions and they tell me to use .trace()

However when a minified library throws an error, I don't have an option to add a .trace()

In Node.js when you get an error it shows a stack trace automatically.

Is there no such option to view the stack trace in firefox?

laggingreflex
  • 32,948
  • 35
  • 141
  • 196
  • Duplicate of http://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception. Also, develop in Chrome. – Mike H. Jun 05 '14 at 12:20
  • Many people already answered it, did you Google it once. First result says -http://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception did you try this out – Harshit Laddha Jun 05 '14 at 12:21
  • @MikeHometchko I acknowledged that in my question that I've read that question. I can't call `.trace()` – laggingreflex Jun 05 '14 at 12:25
  • @laggingreflex so you're saying that for some reason you can't breakpoint your code and review the stack trace through firebug/chrome dev console? If you are using a minified version of a script on production then well done. Why wouldn't you be using the unminified version for debugging? That's what it's for... – Mike H. Jun 05 '14 at 12:44

1 Answers1

1

Firefox has a built in debugger, accessible by ctrl+shift+s. Now would be a good time to read the instructions. Seeing as you're using minified Javascript, the Auto Prettify Minified Sources option might come in handy. Usually it's better to use the full-fat Javascript source code until deployment.

spender
  • 117,338
  • 33
  • 229
  • 351
  • Does it only show the stack trace when you manually put stop-markers? It's showing empty otherwise for my error. – laggingreflex Jun 05 '14 at 12:28
  • @laggingreflex: That would be one way... Place a break-point on the line that causes the error... If you install Firebug, it has a "break on error" feature that breaks execution the moment an error occurs, allowing you to look at the callstack at the moment the error occurred. There might be a similar option in the on-board debugger. It certainly seems quite advanced compared to the last time I looked. – spender Jun 05 '14 at 12:33
  • Ah yes, there is a Pause on exception. – laggingreflex Jun 05 '14 at 12:38