pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.45k stars 290 forks source link

Needs updating to React@17 #93

Closed looeee closed 1 year ago

looeee commented 3 years ago

When I run npm i -D gltfjsx I get the following error:

code ERESOLVE
ERESOLVE unable to resolve dependency tree
Found: react@17.0.2
node_modules/react
  peer react@"^16.8 || ^17.0" from @radix-ui/react-arrow@0.0.11
  node_modules/@radix-ui/react-arrow
    @radix-ui/react-arrow@"0.0.11" from @radix-ui/react-popper@0.0.14
    node_modules/@radix-ui/react-popper
      @radix-ui/react-popper@"0.0.14" from @radix-ui/react-tooltip@0.0.16
      node_modules/@radix-ui/react-tooltip
        @radix-ui/react-tooltip@"0.0.16" from leva@0.9.10
        node_modules/leva
  peer react@"^16.8 || ^17.0" from @radix-ui/react-polymorphic@0.0.10
  node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-polymorphic
    @radix-ui/react-polymorphic@"0.0.10" from @radix-ui/react-arrow@0.0.11
    node_modules/@radix-ui/react-arrow
      @radix-ui/react-arrow@"0.0.11" from @radix-ui/react-popper@0.0.14
      node_modules/@radix-ui/react-popper
        @radix-ui/react-popper@"0.0.14" from @radix-ui/react-tooltip@0.0.16
        node_modules/@radix-ui/react-tooltip
    @radix-ui/react-polymorphic@"0.0.10" from @radix-ui/react-primitive@0.0.11
    node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-primitive
      @radix-ui/react-primitive@"0.0.11" from @radix-ui/react-arrow@0.0.11
      node_modules/@radix-ui/react-arrow
        @radix-ui/react-arrow@"0.0.11" from @radix-ui/react-popper@0.0.14
        node_modules/@radix-ui/react-popper
  46 more (@radix-ui/react-primitive, ...)

Could not resolve dependency:
peer react@"^16.0.0" from react-reconciler@0.24.0
node_modules/ink/node_modules/react-reconciler
  react-reconciler@"^0.24.0" from ink@3.0.8
  node_modules/ink
    ink@"^3.0.7" from gltfjsx@4.2.2
    node_modules/gltfjsx
      dev gltfjsx@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

See C:\Users\Lewy\AppData\Local\npm-cache\eresolve-report.txt for a full report.

A complete log of this run can be found in:
    C:\Users\Lewy\AppData\Local\npm-cache\_logs\2021-06-07T07_07_40_111Z-debug.log

If I install with --legacy-peer-deps then it installs OK but running npx gltfjsx model.glb gives a whole load of errors including:

 - 1. You might have mismatching versions of React and the renderer (such as React DOM)
 - 2. You might be breaking the Rules of Hooks
 - 3. You might have more than one copy of React in the same app

So presumably it's now complaining that I've forced an install of both React@16 (peerdep) and React@17 (standard dep).

drcmda commented 2 years ago

are you using it as a part of the repo? i always just use it with npx and then it cant be confused with any other react version in node-modules

looeee commented 2 years ago

Yeah, using it via npx works fine and that's what I've been doing. However when working on a client project I prefer to use version control for all tooling. In this case I want the client to be able to update models once I've passed over the project - even if they don't do that for two years I'd rather all the versions are locked so that everything still just works.

drcmda commented 2 years ago

i updated it to react 17