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]);