Build error when api route having dynamic parameter on next 15
Answered
Irish Red and White Setter posted this in #help-forum
Irish Red and White SetterOP
Gettign build error on all dynamic routes
Type error: Route "app/api/departments/[id]/members/route.ts" has an invalid "GET" export:
Type "{ params: { id: string; }; }" is not a valid type for the function's second argument.
2 Replies
@Irish Red and White Setter Gettign build error on all dynamic routes
Type error: Route "app/api/departments/[id]/members/route.ts" has an invalid "GET" export:
Type "{ params: { id: string; }; }" is not a valid type for the function's second argument.
-{params: {id:string}}
+{params: Promise<{id:string}>}
Answer
@Yi Lon Ma diff
-{params: {id:string}}
+{params: Promise<{id:string}>}
Irish Red and White SetterOP
Thanks alot that works