brianzinn / react-babylonjs

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

Latest version causes an issue, 3.0.31 is okay #286

Closed davisgamedev closed 1 year ago

davisgamedev commented 1 year ago

yarn version 3.5.0

when using @latest I get the following error

web | ERROR in ../node_modules/react-babylonjs/dist/react-babylonjs.js 1:425-471 web | Module not found: Error: Can't resolve 'react-dom/client' in 'E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-babylonjs\dist' web | resolve 'react-dom/client' in 'E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-babylonjs\dist' web | Parsed request is a module web | using description file: E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-babylonjs\package.json (relative path: ./dist) web | Field 'browser' doesn't contain a valid alias configuration web | resolve as module web | E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-babylonjs\dist\node_modules doesn't exist or is not a directory web | E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-babylonjs\node_modules doesn't exist or is not a directory web | E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\node_modules doesn't exist or is not a directory web | looking for modules in E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules web | existing directory E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-dom web | using description file: E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-dom\package.json (relative path: .) web | using description file: E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-dom\package.json (relative path: ./client) web | E:\Documents\vscode\redwood-babylon\redwood-babylon\node_modules\react-dom\client doesn't exist
web | E:\Documents\vscode\redwood-babylon\node_modules doesn't exist or is not a directory web | E:\Documents\vscode\node_modules doesn't exist or is not a directory web | E:\Documents\node_modules doesn't exist or is not a directory web | E:\node_modules doesn't exist or is not a directory web | @ ./src/components/Babylon/Examples/ReactBabylonExample/ReactBabylonExample.tsx 27:0-48 50:86-92 62:38-43
web | @ ./src/pages/BabylonPage/BabylonPage.tsx 5:0-108 10:39-58 web | @ ./src/Routes.tsx 5:16-57 web | @ ./src/App.tsx 9:0-30 18:100-106 web | @ ../node_modules/@redwoodjs/web/dist/entry/index.js 6:45-73

Using 3.0.31 is okay (just grabbed a previous version at random, which was listed on the readme as the last babylon 4.x support)

yarn.lock.txt

brianzinn commented 1 year ago

Looks like you are using 17.0.2 of react-dom? Thought that had already react-dom/client. The Html component of this library relies on a more recent version of React for that. I'm not sure exactly what the minimum is. Certainly back on 3.0.31 a lower version of React did work... did you try React 18 or that's too big of a jump for you? I've through about spinning off Html (and some other snippets) o a helpers library....

davisgamedev commented 1 year ago

Awesome yup both react and react-dom were super out of date and I hadn't noticed, thank you for looking into this for me :)