November 29, 2021, 4:29pm
We’ve been facing some random editor issue when manipulating with entities instantiated from templates.
Here’s the listing from the console:
Attempting to delete the entity that caused the problem, we get following error:
All this together is preventing the project from being loaded:
November 29, 2021, 4:32pm
That happened 3 or four times in a week with different entities and templates.
This is quite common issue, as I’ve seen the same error happened to another project of another developer:
Does this happen only when launching from the editor before the application starts, or doe sit also happen after the app is loaded and you move things around in the editor?
November 29, 2021, 4:38pm
The only possibility to fix it is restoring a last breakpoint (which is always painful because of losing all the progress, you know…)
Could you guys take a look at that? E.g. suggest a snippet that could help to remove all these broken entities via the editor API or in any other way?
P.S. I’ve tried to delete that entity via
let bugged = editor.entities.root.filter(entity => entity.viewportEntity._guid === "529aef2d-930d-46ea-a620-fa4b0ef91bfc");
editor.entities.delete([bugged]).then(r => console.log("Result: ", r)).catch(e => console.log("Error ", e));
Unfortunately, that causes the same error (api.js:1027 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘get’)
November 29, 2021, 4:39pm
I can’t even launch the app via
Out of curiosity, are you preloading your template assets? It could be that the template asset itself, or pieces of it have not been loaded by the time it’s being called to be instantiated and added to the graphNode.
November 29, 2021, 4:46pm
The error is thrown with preload checkbox set and unset. As well as with both enabled/disabled broken entities.
November 29, 2021, 4:51pm
We are aware of the issue and have a fix in review to prevent it from happening with the reproducible stops that we have so far.
As it has already happened so far in a couple of your projects, please use these steps to resolve it:
Cannot find child entity of parent "Root" - Editor error, can't delete entities
November 29, 2021, 4:52pm
If you are having issues with the steps as it seems like you have a few, please do let us know and we will help as much as we can.
For the short term until the fix is release, do not use the duplicate command for entities and use copy and paste instead.
November 29, 2021, 4:55pm
@yaustar, thank you for the super-fast reply and a possible way to fix the issue!
Indeed, I remember we were using duplicate command sometimes and it might be the reason of the issue.