# Error with glTF loader module in recent 5.0.1+ releases

**URL:** <https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016>\
**Category:** Bugs\
**Created:** [April 2, 2022, 1:38pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016 "2022-04-02T13:38:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaliatech](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kaliatech/32/13557_2.png) [@kaliatech](https://forum.babylonjs.com/u/kaliatech)\
**Post date:** [April 2, 2022, 1:38pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/1 "2022-04-02T13:38:36Z")

</div>

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:

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

```

This simple vite repo can be used to reproduce:

- [GitHub - kaliatech/babylon-docs-vite-webxr: Example project setup for WebXR development using Babylon.js ES6 modules.](https://github.com/kaliatech/babylon-docs-vite-webxr)

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](https://github.com/kaliatech/babylon-docs-vite-webxr/commit/f6c9b7ce024224f4829981369ec91494dd655f7e) in order to avoid errors loading controllers. These [docs](https://doc.babylonjs.com/divingDeeper/webXR/webXRDemos#install-babylonjs-es6-packages) should eventually be updated/replaced when things stabilize.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 4, 2022, 3:21pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/2 "2022-04-04T15:21:52Z")

</div>

cc @RaananW

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 4, 2022, 3:22pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/3 "2022-04-04T15:22:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 4, 2022, 3:24pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/4 "2022-04-04T15:24:34Z")

</div>

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](https://github.com/BabylonJS/Babylon.js/issues/12330)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 4, 2022, 6:09pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/5 "2022-04-04T18:09:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simon/32/45590_2.png) [@simon](https://forum.babylonjs.com/u/simon)\
**Post date:** [June 27, 2022, 5:05pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/6 "2022-06-27T17:05:55Z")

</div>

Hey!

@RaananW @sebavan @kaliatech

I think i have an a ocasion to awake this topic again. I didn’t have any troubles on version 5.5.6 but if i switch version on 5.12.1 i got a set of equal errors:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/4/e4ac48de37f7687d6a40bd0157c19c91c42989af.png)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [June 27, 2022, 5:44pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/7 "2022-06-27T17:44:58Z")

</div>

have you installed this dependency? if not, make sure you install any version above 5. prefferably 5.12.1

---

<div class="post-metadata">

**Author:** ![simon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simon/32/45590_2.png) [@simon](https://forum.babylonjs.com/u/simon)\
**Post date:** [June 28, 2022, 1:16pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/8 "2022-06-28T13:16:41Z")

</div>

Yes i was installed this dependency.

When i use version of package 5.5.6 everything is OK

But if i use 5.12.1 i had get a error

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [June 28, 2022, 1:37pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/9 "2022-06-28T13:37:19Z")

</div>

Can you share your package.json? we have moved to peer-dependency resolution, so it might be the issue at hand.

---

<div class="post-metadata">

**Author:** ![simon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simon/32/45590_2.png) [@simon](https://forum.babylonjs.com/u/simon)\
**Post date:** [June 29, 2022, 10:17am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/10 "2022-06-29T10:17:48Z")

</div>

With this package i got a error

 ![package](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/e/1eb3a3bee87ee794ebfe6327c2203937fc7c1b48.png)

When i use package with versions 5.5.6 all is ok

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 29, 2022, 12:54pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/11 "2022-06-29T12:54:56Z")

</div>

Looks like you would need to add [https://www.npmjs.com/package/babylonjs-gltf2interface](https://www.npmjs.com/package/babylonjs-gltf2interface) as a dependency

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 11, 2022, 11:30am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/12 "2022-07-11T11:30:33Z")

</div>

I wonder - your npm install command should actually notify you that there are missing peer dependencies. Is it not the case?

---

<div class="post-metadata">

**Author:** ![simon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/simon/32/45590_2.png) [@simon](https://forum.babylonjs.com/u/simon)\
**Post date:** [July 19, 2022, 12:43pm UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/13 "2022-07-19T12:43:11Z")

</div>

Yeah…

Sorry about that and about my long time answer.

I just skipped npm message 🤦‍♂️

Now all is work! Thank tou @sebavan & @RaananW

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [October 22, 2024, 9:34am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/14 "2024-10-22T09:34:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/optimized/3X/1/8/18679eed4673c5934b7fc4114de0976e21049344_2_690x39.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/5/55f1a4f28ad332d70af08a52acd442883ff04a9a.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/b/8bb3a7eb8fa9c401ffd592c3b72aa6c649296f1b.png)  
I have configured it, but there will still be errors.  
@sebavan @RaananW

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 22, 2024, 9:47am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/15 "2024-10-22T09:47:17Z")

</div>

no need to add it to types (no need to add any of them to types) typescript is dealing with it on its own. The gltf2interface package has no main file, it is pure typing. Are you importing something directly? Can you share your setup?

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [October 22, 2024, 9:49am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/16 "2024-10-22T09:49:04Z")

</div>

Here’s how I introduced it:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/c/cc3d7c67072c713954a8e8bcc66a47a6c068bc6f.png)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 22, 2024, 9:51am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/17 "2024-10-22T09:51:45Z")

</div>

I meant the project itself, how is the compilation being done.  
Typescript should consume the typings only. the gltf2interface package has no compiled source, as it has no active code. It does have a few enums (and other types) that your compiler might try to convert to code, but that should be a part of your project and is not a part of the package itself. At least this is the intension of the package.

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [October 22, 2024, 9:53am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/18 "2024-10-22T09:53:37Z")

</div>

This is the configuration:

```auto
{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "module": "ESNext",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "skipLibCheck": true,

    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve",
    "allowJs": true,

    "strict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noFallthroughCasesInSwitch": true,
    "baseUrl": "./",
    "paths": {
      "@/*": ["src/*"]
    },
    "types": ["@babylonjs/core", "@babylonjs/loaders"],
    "composite": true
  },
  "include": ["src/ **/*.ts", "src/** /*.tsx", "src/ **/*.vue", "test/** /*.ts"],
  "exclude": ["src/meta3d/libs/stats.module.js"],
  "references": [{ "path": "./tsconfig.node.json" }]
}

```

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [October 22, 2024, 9:56am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/19 "2024-10-22T09:56:46Z")

</div>

I wrote it with reference to glTFLoader.ts

> <https://github.com/BabylonJS/Babylon.js/blob/35e9ef5f7769c7b6f28e43b28a948012f373411f/packages/dev/loaders/src/glTF/2.0/glTFLoader.ts#L31>

---

<div class="post-metadata">

**Author:** ![brightMoon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brightmoon/32/9959_2.png) [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Post date:** [October 22, 2024, 9:59am UTC](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016/20 "2024-10-22T09:59:56Z")

</div>

If all use import type {xxx} from ‘babylonjs-gltf2interface’, the project can run normally, but the ts code will prompt

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/c/bce8cd87833a1cbfa115023ee099794e7efef432.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/1/016555c7a213d408f92a1ef08285cea1e1478ecf.png)

[Next page](https://forum.babylonjs.com/t/error-with-gltf-loader-module-in-recent-5-0-1-releases/29016.md?page=2)
