Hello everyone. I make some project on Cocos Creator v2.2.2 and i have unpleasant situation a few days ago. My game has a few scenes and sometimes when i load second scene browser page begin spam exceptions into developer console. The last exceptions thrown point at render-flow.js:75 script.
On line 75 is a function that call callbacks render method of various renderer components, as I understand it. And the main problem in this case is that the callback may turn out to be a random rendering function. You will think that the problem is in the spine component or the sprite component, because no other exceptions are thrown. But is not.
I began disable and removing assets and code and got a small example (before tested other options a couple of days).
The essence of the method is as follows:
- Create two scripts.
- Attach scripts on nodes (difference in my case)
- In 1 script at onLoad method call node.active = false
- In 2 script at start method we call new method from script 1 with sprite.enabled = false & node.active = true body.
This result is guaranteed to start throwing exceptions to the console until the sprite component is turned back on. In my app its issue happened by accident when i set identical Sprite Frame in sprite component that was set in node prefab in scene. If method from 4 move into start method of script 1, all be alright.
Maybe this situation not a bug, but it’s unobvious thing that took a long time to solve. And you need to find the right combination of calls to make it work.
I attach the project archive for the possibility of repetition.
assets.zip (3.0 KB)