Urgent: Broken AdvancedDynamicTexture

Starting this afternoon all BabylonJS apps that have this line wouldn’t work:
advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);

HELP!
Here is the console log

babylon.gui.min.js:16 Uncaught TypeError: Cannot read properties of undefined (reading ‘RegisteredTypes’)
at Module. (babylon.gui.min.js:16)
at i (babylon.gui.min.js:1)
at Module. (babylon.gui.min.js:16)
at Module. (babylon.gui.min.js:16)
at i (babylon.gui.min.js:1)
at babylon.gui.min.js:1
at babylon.gui.min.js:1
at babylon.gui.min.js:1
at babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:16
i @ babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:16
(anonymous) @ babylon.gui.min.js:16
i @ babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:1
(anonymous) @ babylon.gui.min.js:1
babylon.js:16 Babylon.js v5.0.0-alpha.48 - WebGL2
fca687e8:1828 Uncaught TypeError: Cannot read properties of undefined (reading ‘AdvancedDynamicTexture’)
at createScene (fca687e8:1828)
at selectpiano (fca687e8:2459)
at fca687e8:2469

Pinging @msDestiny14

Do you have a playground of this?

Works for me in this playground https://playground.babylonjs.com/#91I2RE#1 but I would recommend clearing your cache.

No playground. It’s already in prod. I didn’t touch the code. Suddenly this afternoon this function causes problems.

Doesn’t work after clearing cache. It must be something in BabylonJS side, because I didn’t change the code, and it had worked for months before!!! Just this afternoon, this basic function doesn’t work.

[Log] Babylon.js v5.0.0-alpha.48 - WebGL2 - Parallel shader compilation (babylon.js, line 16)
[Error] TypeError: undefined is not an object (evaluating ‘BABYLON.GUI.AdvancedDynamicTexture’)

Please do share if possible, out of curiosity. :slight_smile:

Bad news. It’s still not working. Before there is no assigned var advancedTexture; But I guess that wasn’t the problem. Even after var advancedTexture I get the same error:
TypeError: undefined is not an object (evaluating ‘BABYLON.GUI.AdvancedDynamicTexture’)

@msDestiny14 Can I see the playground code? Did you also use the exact same function?

 // GUI
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");

That’s very strange. Can you put it in html and I’ll test it with my Chrome and Safari browser? Maybe it’s a browser problem!!!

sample (2).zip (3.9 MB)

This is the downloaded playground with all the related files.

I mostly use chrome and edge and have been working with GUI all day so this is quite puzzling indeed. :thinking:

@msDestiny14 I grabbed one of the earlier deployed code that worked in the past and tried it… also had the same error. I think this is the BabylonJS/browser side issue… Maybe somehow the updated browsers didn’t like something inside the GUI module.

Did you try the zip? Also curious what browser you are using.

This is the culprit:
I use https://cdn.babylonjs.com/gui/babylon.gui.min.js
You use https://preview.babylonjs.com/gui/babylon.gui.min.js

So basically cdn is broken for now. Thanks for sending your html @msDestiny14

1 Like

They also means you are using the preview GUI. You need to use either preview or cdn with all of your packages

3 Likes

Very good point!

1 Like

Also since you’re using it in production, it’s good to consider that changes to the linked code could cause your product to stop working. There’s a way to link to a specific version I think but I can’t remember or find how to do it RN (that way you can use the latest version that you’ve tested on).