TypeError: Cannot read property 'gizmo' of null

TypeError: Cannot read property ‘gizmo’ of null
2484
at _updateGizmos (E:\CocosCreator\resources\app.asar\editor\page\scene-utils\engine-events.js:1:1258)
at Array.forEach (native)
at _updateGizmos (E:\CocosCreator\resources\app.asar\editor\page\scene-utils\engine-events.js:1:1295)
at Array.forEach (native)
at _updateGizmos (E:\CocosCreator\resources\app.asar\editor\page\scene-utils\engine-events.js:1:1295)
at Array.forEach (native)
at _Class.onPostUpdate (E:\CocosCreator\resources\app.asar\editor\page\scene-utils\engine-events.js:1:1476)
at EventListeners.invoke (E:\CocosCreator\resources\engine\cocos2d\core\event\event-listeners.js:49:29)
at _Class.emit (E:\CocosCreator\resources\engine\cocos2d\core\event\event-target.js:357:37)
at _Class.visit (E:\CocosCreator\resources\engine\cocos2d\core\CCDirector.js:296:14)

突然就疯狂报错,把脚本全部删掉也是这样,模拟运行没问题,就是场景编辑器看不到东西了,求大神解答

1赞

这个大概是什么场景下会出现的呢,看样子像是某个节点变为 null 了

I just had this error and this was the only post that showed up on google.

Apparently you can’t have a variable called _id as in private _id: number = -1; for example.

Renaming _id to something else made the error go away.

我的版本是1.7,我也遇到过一次,操作好像是我在一个场景,删了一个节点,不知道什么原因是名字删了,但是节点却还在,而且还不是那种默认的名字,好像显示的是null,然后就疯狂出错了,解决办法只能删了出错的这个场景,然后在重新写,只能提供这点信息了

不幸遇到了这个问题,不知道原因在哪里呀,请问各位有没有具体解决方案?

把那个场景删了重做,删之前最后复制一份

1赞

我选择了一个隐藏的组件 在属性框内点击了显示 就好了

我也遇到这个问题了,现在疯狂报错中~

在场景文件fire中,找到component里的null,然后删除。

6赞

这个是正确的解决方案,必须赞一个