Uncaught (in promise) TypeError: advancedTexture.parseFromSnippetAsync is not a function

Hello Babylonian Gurus!

Finally I have decided to start my practice with this wonderful framework.
I have set up local environment using Babylon.js ES6 support with Tree Shaking.
Created small GUI using Online Gui Editor and saved it to Snippets Server.

Now I want to display it in my scene according to the docs and Playground example.

Unfortunately in my local environment I receive below exception:

index.js:68 Uncaught (in promise) TypeError: advancedTexture.parseFromSnippetAsync is not a function

Please advice, what could be the reason of that behavior?

My import of AdvancedDynamicTexture:

import { AdvancedDynamicTexture } from "@babylonjs/gui/2D/advancedDynamicTexture"

my load from snippet inside scene creation function:

var createScene = async function() {
...
    var advancedTexture = AdvancedDynamicTexture.CreateFullscreenUI("GUI", true, scene);
    let loadedGUI = await advancedTexture.parseFromSnippetAsync("#J04Z3N");  
    return scene
}

package.json:

"devDependencies": {
    "@babylonjs/core": "^4.2.0",
    "@babylonjs/gui": "^4.2.0",
    "@babylonjs/inspector": "^4.2.0",
    "@babylonjs/loaders": "^4.2.0",
    "@babylonjs/materials": "^4.2.0",
    "@babylonjs/post-processes": "^4.2.0",
    "@babylonjs/procedural-textures": "^4.2.0",
    "@babylonjs/serializers": "^4.2.0",
    "webpack": "^5.62.1",
    "webpack-cli": "^4.9.1",
    "webpack-dev-server": "^4.4.0"
  }

I am sorry for formatting - it is my first post in this community.

Roman

2 Likes

Hello! this feature was introduced with v5.0… Can you try with the new engine?

6 Likes