someone may please for love of god, write in some doc a definitive explain about this kind of error. Not just to JS but TS too. I found topics about that and was made some changes on babylonjs and I could contour the problem and now, my simple program don’t has any error. But, it only shows the window of babylon when a scroll event occurs.
Just for someone interested in the solution:
install cannon by npm
and in the index.ts, before babylon import, insert the line:
window.CANNON = require( ‘cannon’ );
NOTE: this don’t solve the error from compiler showed by vscode.
Yeah, the docs really should cover the setup process. In case anyone else is struggling with it, here’s what I did to solve it:
npm install cannon npm install --save-dev @types/cannon
Then, in code:
import cannon from "cannon"; window.CANNON = cannon; scene.enablePhysics();