Next.js Discord

Discord Forum

Build error when api route having dynamic parameter on next 15

Answered
Irish Red and White Setter posted this in #help-forum
Open in Discord
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.
Answered by Yi Lon Ma
-{params: {id:string}}
+{params: Promise<{id:string}>}
View full answer

2 Replies