-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Unknown Procedure Type - Next.js App Router #431
Comments
Facing the same issue. Any update on this? |
see fix |
Forked and Added support for Next.js 14. |
@jlalmes / @alex-streza, i faced the same issue when i'm trying to use this via nest application. the issue lies in
currently this is the method implementation: const getProcedureType = (procedure: OpenApiProcedure): ProcedureType => {
if (procedure._def.query) return 'query';
if (procedure._def.mutation) return 'mutation';
if (procedure._def.subscription) return 'subscription';
throw new Error('Unknown procedure type');
}; changing this to below: const getProcedureType = (procedure: OpenApiProcedure): ProcedureType => {
if (procedure._def.query) return 'query';
if (procedure._def.mutation) return 'mutation';
if (procedure._def.subscription) return 'subscription';
if (procedure._def.type) return procedure._def.type; // return type if it exists on _def without breaking existing functionality
throw new Error('Unknown procedure type');
}; may solve this issue. This is the basic stackblitz app to reproduce this. PS: i'm using @trpc/server@next version. |
Any solutions? facing the same |
I'm running a project using create-t3-turbo and wanted to add OpenAPI support to trpc routers but I keep getting this error, any help is much appreciated, kinda counting on getting OpenAPI support this way.
I went in the procedure.js file to debug and saw that
procedure._def
doesn't seem to exist in my trpc: next version (11.0.0-next-alpha.149+11361b82d)I'm not 100% certain if it's because of this but I'm also using trpc in app router and trpc-openapi in pages/api
pages/api/[...trpc].ts
trpc.ts
The text was updated successfully, but these errors were encountered: