This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 156
Support For t3-app Next js 14 with app router #442
Comments
Forked and Added support for Next.js 14. |
@sutarrohit pretty sure that error happens because you're using tRPC v11. Either downgrade back to v10 (recommended if you really need the library) or you can do something like this (where you define your router): const appRouter = router({
test: testRouter,
auth: authRouter,
});
const procedures = appRouter._def.procedures;
Object.keys(procedures).forEach((key) => {
const def = (procedures[key as keyof typeof procedures] as unknown as AnyProcedure)?._def;
// @ts-expect-error: internal API
if (def?.meta?.openapi) {
switch (def.type) {
case "query":
// @ts-expect-error: unstable support for tRPC v11
def.query = true;
break;
case "mutation":
// @ts-expect-error: unstable support for tRPC v11
def.mutation = true;
break;
case "subscription":
// @ts-expect-error: unstable support for tRPC v11
def.subscription = true;
break;
}
}
});
export { appRouter }; This is something I've been doing and it seems to work but it is in no way stable and I would not recommend running it in production. |
@Pridestalkerr thanks definitely check for your solution |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Greeting, I am using t3-app with next js 14 and app router. i've setup the
trpc-openapi
for OpenAPI but can't get the adapters working and is not clarified in the docs.The text was updated successfully, but these errors were encountered: