From f66e30a0c84eb4f74182d79b23e3c5e900788e10 Mon Sep 17 00:00:00 2001 From: Inshiku-Han Date: Mon, 22 Apr 2024 16:48:49 +0900 Subject: [PATCH] fix(cli): Only install `@trpc/next` when router style is page router (#1835) Co-authored-by: juliusmarminge --- .changeset/thick-weeks-compete.md | 5 +++++ cli/src/installers/trpc.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/thick-weeks-compete.md diff --git a/.changeset/thick-weeks-compete.md b/.changeset/thick-weeks-compete.md new file mode 100644 index 0000000000..f78a6c2f73 --- /dev/null +++ b/.changeset/thick-weeks-compete.md @@ -0,0 +1,5 @@ +--- +"create-t3-app": patch +--- + +Only install @trpc/next when router style is page router diff --git a/cli/src/installers/trpc.ts b/cli/src/installers/trpc.ts index ddad8b7cbe..9c0e0d7594 100644 --- a/cli/src/installers/trpc.ts +++ b/cli/src/installers/trpc.ts @@ -17,7 +17,6 @@ export const trpcInstaller: Installer = ({ "superjson", "@trpc/server", "@trpc/client", - "@trpc/next", "@trpc/react-query", ], devMode: false, @@ -113,6 +112,12 @@ export const trpcInstaller: Installer = ({ ] ); } else { + addPackageDependency({ + dependencies: ["@trpc/next"], + devMode: false, + projectDir, + }); + const utilsSrc = path.join(extrasDir, "src/utils/api.ts"); const utilsDest = path.join(projectDir, "src/utils/api.ts"); copySrcDest.push([utilsSrc, utilsDest]);