I’m trying to upgrade BabylonJS from alpha 16 to alpha 22. One of main change is the complete change on the way BabylonJS export itseft. If I understand correctly now all the code seems to be converted to ES6 modules.
So I have change all my import XXX from 'babylonjs/es6' into import XXX from '@babylonjs/core'. But this trigger an internal error in BabylonJS:
Uncaught (in promise) TypeError: Cannot read property 'CubeTexture' of undefined
at Function.Tools.Instantiate (tools.js:219)
at Function.Texture.Parse [as _TextureParser] (texture.js:512)
at Function.SerializationHelper.Parse (decorators.js:370)
at Function.StandardMaterial.Parse (standardMaterial.js:1518)
at Function.Material.Parse (material.js:1065)
at loadAssetContainer (babylonFileLoader.js:127)
at Object.load (babylonFileLoader.js:635)
at sceneLoader.js:684
at dataCallback (sceneLoader.js:188)
at XMLHttpRequest.onReadyStateChange (tools.js:854)
This is throw when I do a SceneLoader.AppendAsync(path, '', this.scene)
I did not change the object located at path.
Is there some new import to do to make this works? Thank for you help
Also something is strange looking at the error callStack. CubeTexture should not be relying on custom type therefore not ending up in the Tools.Instantiate part.
Could you let me know the exorter you are using to create the babylon file ?
And finally do you happen to have a warning like this in the console ?
“… not found, you may have missed an import.” This could help me narrow down the culprit