报错:Cannot read property 'length' of null

大佬们,这个是错你们有吗?(不是必现,但是出现的概率挺高的)
error: [PreviewInEditor] Cannot read property ‘length’ of nullTypeError: Cannot read property ‘length’ of null
at Node._updateSiblingIndex (eval at wrapExecute (D:\Cocos Creators\Creator\3.8.1\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :57692:46)
at eval (eval at wrapExecute (D:\Cocos Creators\Creator\3.8.1\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :108813:18)
at Map.forEach ()
at _sortSiblings (eval at wrapExecute (D:\Cocos Creators\Creator\3.8.1\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :108810:45)
at Director.emit (eval at wrapExecute (D:\Cocos Creators\Creator\3.8.1\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :156299:19)
at Director.tick (eval at wrapExecute (D:\Cocos Creators\Creator\3.8.1\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :21103:20)
at Game._updateC

2赞

同求原因,貌似和删除节点与在update中排序节点有关,但是做了判空了,浏览器没事

遇到同样问题
[PreviewInEditor] Cannot read property ‘length’ of null
TypeError: Cannot read property ‘length’ of null
at Node._updateSiblingIndex (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:71288:46)
at eval (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:133662:18)
at Map.forEach ()
at _sortSiblings (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:133659:45)
at Director.emit (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:170317:19)
at Director.tick (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:27805:20)
at Game._updateCallback (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:28915:22)
at updateCallback (/Applications/Cocos/Creator/3.8.1/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.cache/dev/editor/bundled/index.js:11446:20)

我也遇到了,什么情况

解决了吗,我也遇到了

在load预制体或实例化期间物体或UI,过程中暂停了,就会出现,确保实例化完成后在暂停。

请问暂停指的是什么意思?

同问,编辑器上必现,导致每次都要重新运行一次才正常
image

能提供个复现的demo么,我们也在努力排查这个问题,如果有复现的demo有助于我们解决问题


我们项目昨天有个地方大约90%的概率会出现这个报错,今天没试出来。
在cocos Editor内运行会出现,浏览器运行没出现。

我昨天根据提示的行号,定位到是node类的代码,这里的_children的值是null,加了两个warn输出this.name和this.parent都是空的

调用暂停方法暂停游戏->创建物体->取消暂停->销毁物体,就会出这个错误

3.8.3试了下,并没有出现这个问题

3.8.3在insertChild之后立马destroy就会报这个错

3.8.4还是有同样的问题

3.8.5试看看


今天用3.8.5测试了,还是会报这个错。并且3.8.3,3.8.4并不会卡死界面。3.8.5会卡死界面

是否可以提供个demo,这样有助于我们排查问题,因为我不好复现这个问题,感谢


3.8.3浏览器无报错,手机扫码浏览器也无报错,编辑器百分百报错。