Testbed demos `Can't resolve '@dimforge/rapier2d'`
I'm trying to test out rapier.js for the first time, and according to the Getting started docs, I should be able to use the testbed3d/src/demos directory to get up and running.
Running npm install && npm run start from ${HOME}/rapier.js/testbed2d results in the following compilation error (and all subsequent files complain about being unable to find the module):
ERROR in ./src/index.ts 11:0-28
Module not found: Error: Can't resolve '@dimforge/rapier2d' in '${HOME}/rapier.js/testbed2d/src'
What is the entry point to working with testbed?
Similar (possibly related) issue here. I ran npm i @dimforge/rapier2d and tried to import it from my code and it's throwing a ERR_MODULE_NOT_FOUND. Can't get it to work at all.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '/home/runner/RapierTest/node_modules/@dimforge/rapier2d/' imported from /home/runner/RapierTest/index.js
I'm just getting this on a new 3D project:
Error: Cannot find module '@dimforge/rapier3d'
I have this problem, too:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\repositories\<redacted>\node_modules\@dimforge\rapier2d\' imported from C:\repositories\<redacted>\<redacted>.js
I'm on Windows 10 if that matters.
@dsine-de - I think the underlying issue with this error is in how the bundler works in your solution. For example, I could not get webpack to work at all.
In the end, I used the compat packages with node/typescript solutions and it works fine.
https://rapier.rs/docs/user_guides/javascript/getting_started_js#using-rapier-without-a-bundler
@sebcrozet - I think this should be closed as it isn't an error with the rapier project per say.
It seems that changing the line
"@dimforge/rapier3d": "file:../rapier3d"
in the package.json to
"@dimforge/rapier3d": "latest"
will work