Debugging exceptions deep inside Ext.js

It’s a bit confusing to see errors like

Uncaught TypeError: Cannot call method 'getColumnCount' of undefined

especially when stack-trace is full of ext.js files and has only one call from your files somewhere in top level gui creation call, like creating of Viewport. Fortunately there is a simple solution if you use Chrome Developer Tools – setting breakpoint at the beginning of the function with error and triggering it by reloading page or re-running faulty part of code will allow to print “this” in scope where error is going to happen.

By examining result you can check which element of your gui is falling.