Debugging Javascript Errors in jQuery or 3rd Party Javascript Libraries

When you’re righting some Javascript / jQuery and run your code, you normally would see your errors in your browser inspector’s console tab so you can easily fix them. But, sometimes the error you see appears in 3rd party code that you haven’t even touched, e.g. jQuery. One way to find where the “real” error has occurred is by looking at the call stack. In Chrome Inspector, do the following:

  1. Click the Sources tab
  2. Click the Stop sign until it is purple (Pause at all uncaught exceptions)
  3. Reload the page
  4. Examine the call stack