Why is loading GLB failed?

import * as BABYLON from "@babylonjs/core";

import * as GUI from '@babylonjs/gui';

 BABYLON.SceneLoader.ImportMesh(
            "",
            "https://raw.githubusercontent.com/BabylonJS/MeshesLibrary/master/",
            "PBR_Spheres.glb",
            scene,
            function (meshes) {
                scene.createDefaultCameraOrLight(true, true, true);
                scene.createDefaultEnvironment();
            });

image

error


index.js:1 BJS - [17:20:51]: Unable to load from https://raw.githubusercontent.com/BabylonJS/MeshesLibrary/master/PBR_Spheres.glb: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse

But same code

It is ok .
Why ?

I don’t use to work with modules but I think maybe you need to import Loaders in your file

Look at How to use

Also in the documentation look how to implement extra modules

4 Likes