threejs-ammojs-webpack-example
threejs-ammojs-webpack-example copied to clipboard
Can't resolve 'matter-js'
I followed the instructions, but i get: @yandeu
ERROR in ./node_modules/@enable3d/three-graphics/jsm/flat/physics/physics.js 6:0-98
Module not found: Error: Can't resolve 'matter-js' in '/Users/x/git/game/tests/enable3d-webpack/node_modules/@enable3d/three-graphics/jsm/flat/physics'
After npm install matter-js
it works.. so there must be something wrong with (peer) dependencies
Strange.
matter-js
is a peerDependency of @enable3d/three-graphics
which is a dependency of enable3d
.
only thing that made it compile for me was adding ALL peer dependencies
"dependencies": {
"enable3d": "~0.24.1",
"@types/matter-js": "0.17.6",
"@types/three": "~0.133.1",
"matter-js": "0.17.1",
"phaser": "^3.55.2",
"poly-decomp": "^0.3.0",
"three": "~0.133.1"
},
Maybe it has something to do with our local NPM version. I remember I was on 6.x, while current is 8.x.