pmndrs / gltfjsx

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

Error at M2 MacBook Air #156

Open NoahFD opened 1 year ago

NoahFD commented 1 year ago

(base) weipingtong@Weis-MacBook-Air my-3d-model % npx gltfjsx avatar.glb

ERROR Objects are not valid as a React child (found: Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  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 See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.). If you meant to render a collection of children, use an array instead.

      1. You might have mismatching versions of React and the renderer (such as React DOM)
      1. You might be breaking the Rules of Hooks
      1. You might have more than one copy of React in the same app -See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.). If you meant to render a collection of children, use an array instead. -throwOnInvalidObjectT (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development pe .js:4612:15) -createChild (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:4850:7)

    -reconcileChildrenArr (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development. y js:5100:25) -reconcileChildFibe (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js s :5506:14) -reconcileChildre (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:8 417:28) -updateHostComponen (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js :9059:3) -beginWork (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:10507:14)

    -Object.invokeGuardedCallba (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.develo kProd pment.js:12101:10) -invokeGuardedCallba (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.j k s:12292:31) -beginWork$1 (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:16531: 7) (node:24384) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time (Use node --trace-warnings ... to show where the warning was created) TypeError: Failed to parse URL from /Users/weipingtong/Desktop/my-3d-model/node_modules/draco3dgltf/draco_decoder_gltf.wasm at new Request (node:internal/deps/undici/undici:5446:19) at Agent.fetch2 (node:internal/deps/undici/undici:6242:25) at Object.fetch (node:internal/deps/undici/undici:7076:20) at fetch (node:internal/bootstrap/pre_execution:199:25) at /Users/weipingtong/Desktop/my-3d-model/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:39:485 at /Users/weipingtong/Desktop/my-3d-model/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:40:128 at Object.createDecoderModule (/Users/weipingtong/Desktop/my-3d-model/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:40:151) at Object. (/Users/weipingtong/Desktop/my-3d-model/node_modules/gltfjsx/src/bin/DRACOLoader.js:2:40) at Module._compile (node:internal/modules/cjs/loader:1120:14) at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)

duc-minh-droid commented 1 year ago

same. using mac and getting the very same error. really hope someone actually know how to fix this

drcmda commented 1 year ago

i think these come when there's a version conflict, for instance when gltfjsx was accidentally installed. could you try to remove gltfjsx from global installs, local installs. i still do not understand the cause for it.

claritise commented 1 year ago

Getting the same issue

ghostmurda commented 1 year ago

same issue on win10