-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
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: