GLTF2Export defines it's own Scene type and crashes typescript

Hello and thank you for being a member of the community!
If you want to report a bug, please make sure to share a repro on the forum:

on line GLTF2Export.GLBAsync(sceneRef.current, glbFile).then((glb) => {

I receive

Argument of type 'import("babylonjs/scene").Scene' is not assignable to parameter of type 'import("/Users/mboujeh/Desktop/coding/wg/wg/node_modules/.pnpm/@babylonjs+core@5.51.0/node_modules/@babylonjs/core/scene").Scene'.
  Types of property '_inputManager' are incompatible.
    Type 'import("babylonjs/Inputs/scene.inputManager").InputManager' is not assignable to type 'import("/Users/mboujeh/Desktop/coding/wg/wg/node_modules/.pnpm/@babylonjs+core@5.51.0/node_modules/@babylonjs/core/Inputs/scene.inputManager").InputManager'.
      Types have separate declarations of a private property '_alreadyAttached'

On this thread, reinstalling node_modules solved the issue. Problems with GLTF2Exporter from @babylonjs/serializers

it didn’t work out for me though

    "@babylonjs/core": "^5.51.0",
    "@babylonjs/serializers": "^5.51.0",
    "babylonjs": "^5.51.0",
    "babylonjs-gltf2interface": "^5.22.0",

You can not use both @babylonjs/core and babylonjs-core in the same app. The first is the es6 version and the second the umd one. You should only use one or the other.

image

2 Likes