Error with glTF loader module in recent 5.0.1+ releases

Worked until 5.0.0, but then in 5.0.1 (and 5.0.2), trying to build/package results in errors like this:

node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.d.ts:11:32 - error TS2307: Cannot find module 'babylonjs-gltf2interface/.js' or its corresponding type declarations.

The incorrect import looks like this:

import type { IProperty } from "babylonjs-gltf2interface/.js";

This simple vite repo can be used to reproduce:

Simply change the package.json from:

  • "@babylonjs/*": "5.0.0"
    to
  • "@babylonjs/*": "5.0.2"

Aside: One non-obvious recent change for anyone doing WebXR work with ES6 modules, is that at some point in the recent 5.0.x releases, it became necessary to also import the animatable side-effects in order to avoid errors loading controllers. These docs should eventually be updated/replaced when things stabilize.

cc @RaananW

I ll try to have to have a quick look, no promises…, but @RaananW will be back tomorrow :slight_smile:

1 Like

You can follow the resolution here error TS2307: Cannot find module 'babylonjs-gltf2interface/.js' or its corresponding type declarations. · Issue #12330 · BabylonJS/Babylon.js · GitHub

1 Like

This will be resolved soon with 5.0.3. Probably in the next hour or two.

2 Likes