gltfjsx icon indicating copy to clipboard operation
gltfjsx copied to clipboard

Warning: Encountered two children with the same key, ` in App`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.

Open ghost opened this issue 4 years ago • 8 comments

when i run > npx gltfjsx models/gltf/xbot.glb --root public/ --verbose`

i get this error

arning: Encountered two children with the same key, `    in App`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
    in ink-box (created by Box)
    in Box (created by ErrorOverview)
    in ink-box (created by Box)
    in Box (created by ErrorOverview)
    in ErrorOverview (created by InternalApp)
    in InternalApp

  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://fb.me/react-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.
            in ink-text (created by Text)
            in Text
            in ink-box (created by Box)
            in Box
            in App
            in App
            in InternalApp

 - 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://fb.me/react-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.
 -     in ink-text (created by Text)
 -     in Text
 -     in ink-box (created by Box)
 -     in Box
 -     in App
 -     in App
 -     in InternalApp
 - throwOnInvalidObjectType (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:4524:15)
 - createChild (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:4757:7)
 - reconcileChildrenArray (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:5008:25)
 - reconcileChildFibers (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:5374:14)
 - reconcileChildren (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:7865:28)
 - updateHostComponent (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:8387:3)
 - beginWork$1 (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:9969:14)
 - Object.invokeGuardedCallbackImpl (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
 - invokeGuardedCallback (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
 - beginWork$$1 (node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15778:7)

ghost avatar Dec 19 '20 13:12 ghost

could you append the glb?

drcmda avatar Dec 19 '20 20:12 drcmda

https://github.com/mrdoob/three.js/blob/dev/examples/models/gltf/Xbot.glb its this one, just one of the standard threejs gltf models

ghost avatar Dec 19 '20 23:12 ghost

cant reproduce unfortunately, runs through here :-(

drcmda avatar Dec 20 '20 08:12 drcmda

I am also encountering the same problem when executing the same command with the model in this codesandbox public/stacy.glb.

SiegeSailor avatar Jan 11 '21 06:01 SiegeSailor

@drcmda i will do some work and put together a PR to try and make the error message less cryptic. let me know if you can provide any context / pointers otherwise ill get started on it later tonight. thank you :)

ghost avatar Jan 12 '21 16:01 ghost

awesome! good luck also, i still can't reproduce :-(

drcmda avatar Jan 12 '21 21:01 drcmda

After a few tests, I found out that the error I was encountering was because I installed the package locally. Everything is working well when I install it globally.

SiegeSailor avatar Jan 17 '21 07:01 SiegeSailor

I can confirm. Got the same error when running locally, where installing globally fixed it.

Pringels avatar Apr 27 '21 09:04 Pringels