Error "AdvancedDynamic TextureInstrumentation" after click GUI on inspector


On my project I get this error when I click on a GUI element in the inspector and the right panel disappears.
I am using XMLLoader to load my GUI elements and I cannot load an XML on the PG to test. I still did an online demo of the problem. I put the inspector.bundle.max.babylon

Load the game, wait until the character is fully loaded. Then select the GUI element in the left panel of the inspector (the right panel disappears)

Here is the error I have:

Uncaught TypeError: Cannot read property ‘AdvancedDynamicTextureInstrumentation’ of undefined

Do you repro in the PG?

How do you reference the inspector?

I believe this is due to the use of XMLLoader and I cannot import any XML file into the PLayground.

I also use several scenes, but I don’t think that is it.

I have this error on the link, the inspector works but when I click on GUI, the window on the right disappears with this error.

What do you mean by how I reference the inspector?

How do you import your inspector? direct URL? Webpack?

Like this :
< script src=“libs/babylon.inspector.bundle.max.js”></scrip t>

Ok so this is not the problem. Can you try without the XMLLoader?

I will try to do without the XMLLoader to be sure that the problem comes from there or not.

I’ll be back in 15 minutes with the result.

It does not come from the XMLLoader, because I have the same result.

I will try to reproduce on the PG in the XMLLoader in this case. Above all, I need to understand what is causing it to reproduce.

1 Like

Oh my God. I looked in Javascript without ever understanding what was wrong.

Then when you told me about my ways of referencing the inspector, I said to myself just now, but if I put that before the referencing of Babylon.

Well, it worked.
Error :
< script src=“libs/babylon.js”>">
< script src=“libs/babylon.inspector.bundle.max.js”>

< script src=“libs/babylon.inspector.bundle.max.js”>
< script src=“libs/babylon.js”>">

Can I understand why we must reference the inspector before Babylon?
This should be explained in the doc, because nothing is said about it:

Not in fact, it is not before babylon.js that the inspector should be referenced, but before babylon.gui.
Conclusion for this to work properly, the order of referencing really changes things.

This is how it is correct :

< script src="libs/babylon.js"></script>
< script src="libs/babylon.gui.min.js"></script>
< script src="libs/babylon.inspector.bundle.max.js"></script>
< script src="libs/babylonjs.materials.min.js"></script>

This should be indicated in the doc I think to avoid that others this mistake when adding the inspector. It must be after the GUI which is also after Babylon.

1 Like