mattgoldspink / grunt-sencha-dependencies

Grunt task to get the list of Ext.require dependencies in your application
MIT License
32 stars 22 forks source link

phantom tracebacks #24

Closed LaurentMox closed 11 years ago

LaurentMox commented 11 years ago

Hi,

How can we get the full traceback from PhantomJS when a JS error occur ?

We have this kind of error and its quite difficult to debug :)

A JavaScript error occured whilst loading your page - this could cause problems with the generated file list. Run with -v to see all errors
TypeError: 'null' is not a constructor (evaluating 'new c(a[0])')

Thanks :)

mattgoldspink commented 11 years ago

@LaurentMox This error crops up because of missing dependency (we run the the ext-debug.js and not ext-debug-all.js so not everything in the Ext framework is loaded for you up front). I'll see what I can do try add more detail into that stack (I have a feeling the ext developer files may have more logging information in them, but I think they bundle the whole framework).

For now a quick way to see what might be going wrong is to switch to ext-debug.js locally in your project and see what errors you get - in theory they should be the same errors you see in phantomjs. Infact we always develop against ext-debug.js so we catch these dependency issues early in development.

Let me know if the above advise doesn't help and I'll see what can be done in terms of better debugging.

revolunet commented 11 years ago

any idea how to get the full stack trace for phantom.onError instead of only a single line message ? would help in detecting where the error occurs. (the error occurs only using phantom, not with real page with ext-debug.js) thanks :)

mattgoldspink commented 11 years ago

@revolunet @LaurentMox There was a bug which meant the verbose logging wasn't working. I've fixed that and pushed to NPM (0.6.2). In addition I've also added the full stack trace into the logs too which should help to debug these problems. Just run with -v and you should get pretty much all the output you need (error, file, line number, stack trace).

Let me know if that helps and then I'll close the issue.

revolunet commented 11 years ago

Thanks Matt, this is a very useful and informative commit :)