Loading babylon file with ES6 imports fails

import { SceneLoader } from '@babylonjs/core/Loading/sceneLoader';

import '@babylonjs/loaders';
import '@babylonjs/core/Loading/Plugins/babylonFileLoader';

I get this error

sceneLoader.js:485 Uncaught (in promise) RuntimeError: Unable to load from https://playground.babylonjs.com/scenes/SSAOcat.babylon: loadAssets of unknown
	Lights:
		Name: Default light, type: Hemispheric
	Materials:
		Name: 01 - Default
	Meshes:
		Name: Camera001.Target, isInstance: YES, # of submeshes: 0, n vertices: 0, parent: NONE
		Name: Decor, isInstance: YES, # of submeshes: 1, n vertices: 306, parent: NONE
		Name: Shcroendiger'scat, isInstance: YES, # of submeshes: 1, n vertices: 77424, parent: NONE
    at errorHandler (sceneLoader.js:485:1)
    at loadAssetContainer (babylonFileLoader.js:493:1)
    at Object.load (babylonFileLoader.js:875:1)
    at sceneLoader.js:517:1
    at dataCallback (sceneLoader.js:175:1)
    at fileTools.js:343:1
    at XMLHttpRequest.onReadyStateChange (fileTools.js:457:1)

Any idea what I’m doing wrong? Using SceneLoader.AppendAsync. The code used to work before updating to 5.22.1 and ES6 imports.

Hey, it’s been a while… but can you show some more code?
Do you try to load
https://playground.babylonjs.com/scenes/SSAOcat.babylon
somewhere in your code?

1 Like

The line loading the file is SceneLoader.AppendAsync('https://playground.babylonjs.com/scenes/', 'SSAOcat.babylon', scene).

can you share the project itself? or a minimal reproduction?

1 Like

Okey, so the error says

Uncaught (in promise) RuntimeError: Unable to load from https://playground.babylonjs.com/scenes/SSAOcat.babylon: loadAssets of unknown

So you can catch the error and see what’s wrong like here:

But in general it looks like it’s working in the PG.
Maybe it’s some network / CORS problem?

The original problem was a missing material import. I’m guessing something similar here.

2 Likes