Compile project with BabylonJs failed with error: Cannot find module 'babylonjs/Animations' or its corresponding type declarations

Hi!

We are trying to upgrade to the new version of the library 6.45.1 and are trying to compile the project. We get several errors in the library itself. Please tell me what could be the reasons for such errors.

Error: node_modules/babylonjs/babylon.module.d.ts:29437:28 - error TS2307: Cannot find module ‘babylonjs/Animations’ or its corresponding type declarations.

29437 import { Animatable } from “babylonjs/Animations”;
~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/babylonjs/babylon.module.d.ts:29557:28 - error TS2307: Cannot find module ‘babylonjs/Animations’ or its corresponding type declarations.

29557 import { Animatable } from “babylonjs/Animations”;
~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/babylonjs/babylon.module.d.ts:73629:43 - error TS2552: Cannot find name ‘DecoderModule’. Did you mean ‘NodeModule’?

73629 export function decodeMesh(decoderModule: DecoderModule, data: Int8Array, attributes: {
~~~~~~~~~~~~~

Error: node_modules/babylonjs/babylon.module.d.ts:99172:30 - error TS2307: Cannot find module ‘babylonjs/Physics/v2’ or its corresponding type declarations.

99172 import { PhysicsShape } from “babylonjs/Physics/v2”;
~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/babylonjs/babylon.module.d.ts:99900:29 - error TS2307: Cannot find module ‘babylonjs/Physics/v2’ or its corresponding type declarations.

99900 import { PhysicsBody } from “babylonjs/Physics/v2”;
~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/babylonjs/babylon.module.d.ts:194203:47 - error TS2552: Cannot find name ‘DecoderModule’. Did you mean ‘NodeModule’?

194203 export function decodeMesh(decoderModule: DecoderModule, data: Int8Array, attributes: {
~~~~~~~~~~~~~

checking! thanks for reporting! :slight_smile:

Will be fixed in the next version:

Fix UMD declaration and add project to test by RaananW · Pull Request #14855 · BabylonJS/Babylon.js (github.com)

2 Likes

Hi

There is one bug left in version 4.6.1

Error: node_modules/babylonjs/babylon.module.d.ts:99903:29 - error TS2307: Cannot find module ‘babylonjs/Physics/v2’ or its corresponding type declarations.

99903 import { PhysicsBody } from “babylonjs/Physics/v2”;
~~~~~~~~~~~~~~~~~~~~~~

if you add “physicsBody” to “babylonjs/Physics/v2”, then the project compiles successfully

that was fixed in a recent PR, but let me check again. Are you sure the version you are referencing is correct? or do you mean 6.46.1?

Sorry about that - I will release a patch very soon.