[ ViteJS + @babylon/inspector ] Error : Could not find module in path: '@babylonjs/core/tslib.es6.js'

I really love vitejs so I try to make my first babylon app with it.

Here is the basic ES6 scene from the playground : upbeat-cherry-7wenm4 - CodeSandbox

However when I try to show the debugLayer (uncomment line 3,4 and 7) I got this strange error :

Could not find module in path: '@babylonjs/core/tslib.es6.js'

Locally on VSCode error it is almost the same

Error: Build failed with 40 errors:
node_modules/@babylonjs/gui/2D/controls/checkbox.js:1:27: ERROR: Could not resolve "@babylonjs/core/tslib.es6.js"
node_modules/@babylonjs/gui/2D/controls/colorpicker.js:1:27: ERROR: Could not resolve "@babylonjs/core/tslib.es6.js"
node_modules/@babylonjs/gui/2D/controls/container.js:1:27: ERROR: Could not resolve "@babylonjs/core/tslib.es6.js"
node_modules/@babylonjs/gui/2D/controls/control.js:1:27: ERROR: Could not resolve "@babylonjs/core/tslib.es6.js"
node_modules/@babylonjs/gui/2D/controls/displayGrid.js:1:27: ERROR: Could not resolve "@babylonjs/core/tslib.es6.js"

Some components inside @babylon/gui try to

      1 │ import { __decorate } from "@babylonjs/core/tslib.es6.js";

…and indeed the file does not exists in the @babylonjs/core package.

It’s also strange because when I browse the source code on github there’s no reference to this import {__decorate } in the typescript source :

I can figure it out why there’s no problem with other builders like webpack !

Have you updated your babylon core package? what version of @babylonjs/core are you using?

make sure to use the latest @babylonjs/core which has this file. This was just recently added (in the latest package)

Thank you it works !

I don’t know why but npm i --save @babylonjs/core installed v5.21 by default, when I force to npm i --save @babylonjs/core@5.22 it works :). My bad I should have check this.

that’s good to know! i’ll check if there is anything wrong with npm