I created a website using Canvas on the client side to display animations. Sometimes it happens that the animations stop moving out of a sudden, so I ran the application in debug mode and got this strange error:
com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.google.gwt.dom.client.ImageElement::getWidth()': JS value of type undefined, expected int
What could be the reason for this behavior? How can a function suddently undefine its return type?
Your code should be alright.
This is a known chrome GWT plugin issue. This happens sporadically without any rule, the easiest solution is to use Firefox for debugging – it’s more stable.
Here is the link for issue discussion: click here