Unhandled Rejection (Error): Cannot find module 'babylonjs/Misc/tools'

When I use the babylonjs-viewer,I get this error.
Unhandled Rejection (Error): Cannot find module ‘babylonjs/Misc/tools’.
I am sure install all the package and set the types:[babylonjs] in tsconfig.json.
Can anybody face the same problem or anybody can help me ? Thanks a lot

Adding @sebavan

Would be amazing if you could share a repro ??? as I can not seem to be able to repro locally.

Hey, have you tried using the @babylonjs/core package instead of the UMD? It works much better, especially if you are importing and not using the global namespace

I think it was babylonjs-viewer bug。And this is my test project repo:

Sorry, just noticed you are talking about the viewer.

In that case you don’t need @babylonjs/core, you will only need the babylonjs-viewer package.

@sebavan , will you have some time debugging this? otherwise I will do it in a day or two.

Could you try replacing babylonjs-viewer by @babylonjs/viewer which should be webpack friendly

1 Like