Friday, May 30, 2014

Re: How to debug "TypeError: 'undefined' is not an object (evaluating 'c.gwtOnLoad')"?

On Friday, May 30, 2014 1:15:18 PM UTC-4, Jens wrote:
While trying to get a widget to display in a div, I'm getting this error:

[Error] TypeError: 'undefined' is not an object (evaluating 'c.gwtOnLoad')
G (ui.nocache.js, line 2)
onScriptLoad (ui.nocache.js, line 16)

What is the best way to figure out exactly what is going on in this case?

Looks like a Nullpointer. Maybe your div isn't available yet? In general compile with PRETTY style so the JavaScript methods have similar names as your Java code. Then you Chrome Dev Tools and stop on any uncaught exception.

But if its the RootPanel.get("ui") thing then I would guess RootPanel.get("ui") might return null. Make sure your "ui" container is in the DOM at the time your GWT app starts.

-- J.

Thanks, I'll make sure to use PRETTY.
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment