Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/472.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用GWT画布时出现奇怪的错误_Javascript_Gwt_Html5 Canvas - Fatal编程技术网

Javascript 使用GWT画布时出现奇怪的错误

Javascript 使用GWT画布时出现奇怪的错误,javascript,gwt,html5-canvas,Javascript,Gwt,Html5 Canvas,我创建了一个网站,在客户端使用画布来显示动画。有时,动画突然停止移动,因此我在调试模式下运行应用程序,并出现以下奇怪错误: 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, e

我创建了一个网站,在客户端使用画布来显示动画。有时,动画突然停止移动,因此我在调试模式下运行应用程序,并出现以下奇怪错误:

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

这种行为的原因可能是什么?函数如何突然取消定义其返回类型?

您的代码应该没有问题。 这是一个已知的chrome GWT插件问题。这种情况偶尔发生,没有任何规则,最简单的解决方案是使用Firefox进行调试-它更稳定


以下是问题讨论的链接:

谢谢您的回复!很高兴知道,尽管我的动画停止工作的原始错误仍然存在。让我们看看是否可以使用Firefox找到真正的错误。