t3-oss / create-t3-app

The best way to start a full-stack, typesafe Next.js app
https://create.t3.gg
MIT License
24.8k stars 1.14k forks source link

react-query not added correctly to package.json with npx create-t3-app@next #235

Closed erik-gross-hardt closed 2 years ago

erik-gross-hardt commented 2 years ago

Describe the bug When answering "Would you like us to run npm install?" with "no" a lot of react query versions are just dumped as the react-query version string.

To Reproduce npx create-t3-app@next ? What will your project be called? testproject ? Will you be using JavaScript or TypeScript? TypeScript ? Which packages would you like to enable? nextAuth, prisma, tailwind, trpc ? Initialize a new git repository? Yes ? Would you like us to run npm install? No (IMPORTANT!)

Expected behavior React-Query beeing added to package.json like this: "react-query": "3.39.2",

Screenshots

Bildschirmfoto 2022-07-21 um 13 58 43
juliusmarminge commented 2 years ago

What @next version is this?

This commit (https://github.com/t3-oss/create-t3-app/commit/546bb2ad048040e45c6ba9cac230b1425f3bad26) should have fixed that.

Would you mind forcing latest next: npx create-t3-app@5.2.1-next.2 and make sure it exists there.

amyisdev commented 2 years ago

I tried manually checking inside the node_modules, and the react-query version is different. This is how it looks like in dist/index.js image This is in src/installers/trpc.ts image

Maybe forgot to build before publishing?

juliusmarminge commented 2 years ago

Maybe forgot to build before publishing?

Wouldnt be the first time lol... can publish new one when i get home or maybe @nexxeln can if he's free?

erik-gross-hardt commented 2 years ago

What @next version is this?

This commit (546bb2a) should have fixed that.

Would you mind forcing latest next: npx create-t3-app@5.2.1-next.2 and make sure it exists there.

This is the result when trying "npx create-t3-app@5.2.1-next.2":

Bildschirmfoto 2022-07-21 um 17 22 09

So the error still occurs with similar output.

joshborseth commented 2 years ago

haha im new to all this, and Im try to learn this stack. This frustrated me last night for soooo long. My package.json said it was using 4.0.0 so I switched to 3.0.0 and now everything seems to work? Is this a good solution to this? Any help is appreciated!

juliusmarminge commented 2 years ago

haha im new to all this, and Im try to learn this stack. This frustrated me last night for soooo long. My package.json said it was using 4.0.0 so I switched to 3.0.0 and now everything seems to work? Is this a good solution to this? Any help is appreciated!

Sorry bout that. The problem is that react-query released their v4 which is incompatible with tRPC 9 (and 10 for now but that will be fixed) so we need to lock it to v3. The way we grab the version is using npm show and if you specify react-query@3 it will list all the v3 versions.

The correct version to use is 3.39.2 which is the latest v3 version. Will publish when I get home.

joshborseth commented 2 years ago

ok awesome I'll use that version. Thanks for the help!

juliusmarminge commented 2 years ago

Just published the next with that fix actually included in the build xD

Here is the outputted package.json when selecting trpc:

package.json ```json { "name": "my-t3-app", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "next": "12.2.1", "react": "18.2.0", "react-dom": "18.2.0", "zod": "^3.17.3", "react-query": "^3.39.2", "superjson": "^1.9.1", "@trpc/server": "^10.0.0-alpha.38", "@trpc/client": "^10.0.0-alpha.38", "@trpc/next": "^10.0.0-alpha.38", "@trpc/react": "^10.0.0-alpha.38" }, "devDependencies": { "@types/node": "18.0.0", "@types/react": "18.0.14", "@types/react-dom": "18.0.5", "eslint": "8.18.0", "eslint-config-next": "12.2.1", "typescript": "4.7.4" } } ```

Closing as completed in version 5.2.1-next.3. Thank you for reporting this issue!