Three.interaction conflict with three.js

Hi , I’m using “three.interaction” to listen for mouse clicks on Object3D.
Now suddenly after reseting node_modules I’m getting:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: xframe@1.1.0
npm ERR! Found: three@0.117.1
npm ERR! node_modules/three
npm ERR! three@"^0.117.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer three@"^0.89.0" from three.interaction@0.2.3
npm ERR! node_modules/three.interaction
npm ERR! three.interaction@"" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Any ideas?
Or is there something internal I should be using for clicks on Object3D?

Consider not using three.interaction - there are better and safer alternatives.

1 Like

Solution:
Updated fork of three.interaction fixes error

Hey @mjurczyk or anyone can you link to some better and safe alternatives? A simple way to handle touch and mouse input?

@mjurczyk better and safer alternatives such as?

most likely not what you expect but this has full pointer events with event bubbling, stop propagation and pointer capture. you can try it here Basic demo - CodeSandbox to this day i haven’t seen a comparable alternate.

edit:

it took a while but i was sure i’ve once seen another alternative to three.interaction and finally found it back, might have more luck with this one and still is maintained GitHub - markuslerner/THREE.Interactive: Fast and simple interaction manager for three.js for enabling mouse and touch events on 3D objects