Description
When i try to build the project using this "npm run build" command using Next.js version 15.1.7 i get 3 bugs:
Type error: Route "app/api/assistants/threads/[threadId]/actions/route.ts" has an invalid "POST" export:
Type "{ params: { threadId: any; }; }" is not a valid type for the function's second argument.
Type error: Route "app/api/assistants/threads/[threadId]/messages/route.ts" has an invalid "POST" export:
Type "{ params: { threadId: any; }; }" is not a valid type for the function's second argument.
Type error: Route "app/api/files/[filedId]/route.ts" has an invalid "GET" export:
Type "{ params: { threadId: any; }; }" is not a valid type for the function's second argument.
I have solved this problem like this in "threads" part:
export async function POST(request, { params }: { params : Promise<{ threadId }> }) {
const threadId = (await params).threadId;
And in the "files" part:
export async function GET(_request, { params }: { params : Promise<{ fileId }> }) {
const fileId = (await params).fileId;