Unable to load .glb files in v5 alpha 44


I’m using v5 alpha 44 but using:

import * as BABYLON from ‘babylonjs’;

// test 1
BABYLON.SceneLoader.ImportMesh("", “/assets/models/”, “Lg_3.glb”, this.scene, (meshes) => {

// test 2
BABYLON.SceneLoader.Append("", “/assets/models/”, “Lg_3.glb”, this.scene, (meshes) => {

Both result in the following:

Unable to find a plugin to load .glb files. Trying to use .babylon default plugin

Unable to load from /assets/models/Lg_3.glb: importScene of undefined from undefined version: undefined, exporter version: undefinedimportScene has failed JSON parse

When using v4.2 this worked however I loose the env skybox with hdr in that version.

What got GLB to work in v4.2 was importing (one of these, can’t remember which one):

  • import “@babylonjs/core/Loading”;
  • import “@babylonjs/loaders”;
  • import “@babylonjs/loaders/glTF”;

Any ideas how to get V5 alpha 44 to load a GLB, is there something different to import now? A different way of doing it?



You can not mix using ‘babylonjs’ and ‘@babylonjs/…’ the packages are incompatible.

Either you use together the bundled version:

import * as BABYLON from ‘babylonjs’;
import “babylonjs/loaders”;

or you only use the scoped packages

import * as MYBABY from ‘@babylonjs/core’;
import “@babylonjs/loaders”;

This is a dupp of Skybox removed after loading model in v4.x but not in v5 alpha - #9 by Darcey