Closed pcdependency closed 3 years ago
It's likely an issue within the module gltfjsx.js. Line 72 has a possible bug?
no, but ¥our node version maybe cant handle optional chaining, i removed it. nice find!
Was this issue resolved? because I am still getting this error trying to use the tool. The error is coming from animations?.length. What is the workaround for this?
PATH\node_modules\gltfjsx\src\gltfjsx.js:72 let hasAnimations = gltf.animations?.length > 0
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
@drcmda I suggest a release? This is still present in downloads but replacing the code that was added on line 72 works great : ] thanks for the fix!
oh, youre right - i was a 100% sure i did release
@drcmda I really like this project and am wondering how I could become a contributor? I have noticed some errors when creating jsx or tsx files and would definitely like to help. Also no worries it's technically fixed.
you could start by making pr's. i would be glad to add more people to the team that looks out for it. there are many interesting things we can still do with it.
@drcmda alrighty will do 😄
I’ve used this tool many times and it somehow doesn't work. I believe this has to do with the update. Now that it has been updated it doesn’t work.
Normally I place my .gltf in my public folder and cd to the public folder. Then I used to run “npx @react-three/gltfjsx [filename.gltf]”, but now the format has changed to just “npx gltfjsx”. Even when I change the command to “npx gltfjsx [filename.gltf]” it doesn’t work. I’ve tested multiple .gltf files with the same result of an Unexpected Token ‘.’. It seems the update broke this useful command. Also the Twitter link at the top links to the old way, it's misleading to new users.