react-three-next
react-three-next copied to clipboard
error on `yarn create r3f-app next my-app -ts`
Upon running yarn create r3f-app next my-app -ts per the docs yields the following error:
Error: create-r3f-app tried to access semver, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Full output:
➤ YN0000: · Yarn 4.0.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + create-r3f-app@npm:1.6.8, @ampproject/remapping@npm:2.2.1, @babel/code-frame@npm:7.22.13, @babel/compat-data@npm:7.23.2, and 315 more.
➤ YN0000: └ Completed in 1s 679ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 319 packages were added to the project (+ 29.93 MiB).
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 2s 62ms
/private/var/folders/fr/g4k50xt53x50ymkb71cr551r0000gn/T/xfs-33816afa/dlx-49456/.pnp.cjs:9092
Error.captureStackTrace(firstError);
^
Error: create-r3f-app tried to access semver, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: semver
Required by: create-r3f-app@npm:1.6.8 (via /private/var/folders/fr/g4k50xt53x50ymkb71cr551r0000gn/T/xfs-33816afa/dlx-49456/.yarn/cache/create-r3f-app-npm-1.6.8-d4d1ca0ded-ef12dd8092.zip/node_modules/create-r3f-app/lib/utils/)
Require stack:
- /private/var/folders/fr/g4k50xt53x50ymkb71cr551r0000gn/T/xfs-33816afa/dlx-49456/.yarn/cache/create-r3f-app-npm-1.6.8-d4d1ca0ded-ef12dd8092.zip/node_modules/create-r3f-app/lib/utils/check-for-update.js
- /private/var/folders/fr/g4k50xt53x50ymkb71cr551r0000gn/T/xfs-33816afa/dlx-49456/.yarn/cache/create-r3f-app-npm-1.6.8-d4d1ca0ded-ef12dd8092.zip/node_modules/create-r3f-app/lib/index.js
- /private/var/folders/fr/g4k50xt53x50ymkb71cr551r0000gn/T/xfs-33816afa/dlx-49456/.yarn/cache/create-r3f-app-npm-1.6.8-d4d1ca0ded-ef12dd8092.zip/node_modules/create-r3f-app/bin/create-r3f-app
Node.js v21.0.0
Yarn 4.0.0
Same issues with Node.js v18.17.1 and Yarn v4.0.1.
@takavfx @bstro using npm works (im using node 21.2.0) : npm create r3f-app next my-app -ts
@ashleymvanduzer 's suggestion worked for me, but only with tailwind, not styled unfortunately.
I'm seeing the same issue, with Yarn v4.0.2 and Node.js v21.6.2 (I also just updated yarn and node to latest, and had the same issue with older versions of both).
Seems like the error comes from Yarn's PnP. I wish there was some way to turn that off during this create command, to see if that helps.
I was also able to use npm and get it to work with that, but nothing looks to be TypeScript? Everything is still .js, not sure if that's unrelated to using npm though.
[Edit]: The command npx create-r3f-app next 3d-trading-cards-demo --typescript worked and DID generate ts files properly. Not sure why it didn't work with npm.
@Bluhurr nice, I had been meaning to try that, had a feeling npx would be the best option for now.