brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
812 stars 102 forks source link

Can't resolve '@babylonjs/core/Behaviors/Meshes/baseSixDofDragBehavior.js' #220

Closed nyngwang closed 2 years ago

nyngwang commented 2 years ago

I got tons of errors like the title one after upgrading from 3.0.31 to 3.1.2. And it turns out there is no such file baseSixDofDragBehaviour.js in the node_modules/ folder when I tried to follow the path indicated by the error message.

brianzinn commented 2 years ago

are you on babylonjs 4.x? I think it's due to 5.0 stuff being explicitly linked. I may need to revisit how I've added, but even more likely I will just update the peer dependency if that's the case.

nyngwang commented 2 years ago

@brianzinn: Oops, all the versions in package.json are set to "^4.2.2", so I think it's probably what you have said.

brianzinn commented 2 years ago

i think for now you are stuck on 3.0.31 as long as you are using a 4.x version of babylon.js - I'll put something in the readme. I suppose I can't be backwards compatible the way it's written right now unfortunately. I'll update the peer dependency version as well until I have time to investigate properly.

Thank-you for reporting.

nyngwang commented 2 years ago

@brianzinn You should notice that my current working version is "3.0.31" and (all deps)"^4.2.2".

flyskywhy commented 2 years ago

Ref to https://github.com/brianzinn/create-react-app-babylonjs/pull/6 , should modify "peerDependencies"

    "@babylonjs/core": "4.x||5.x",
    "@babylonjs/gui": "4.x||5.x",

to

    "@babylonjs/core": "5.x",
    "@babylonjs/gui": "5.x",

in https://github.com/brianzinn/react-babylonjs/blob/v3.1.2/packages/react-babylonjs/package.json

brianzinn commented 2 years ago

thanks for reminding me @flyskywhy - I will update deps and readme this weekend! one of these days I will have time to build the dynamic renderer without explicit imports.. will update also the 2 downstream sample projects 😄

brianzinn commented 2 years ago

This should be fixed on v3.1.3 - please re-open if you have any further issues. The main page readme has instructions for 4.x and peer deps will warn until proper fix is added.