You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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;
The text was updated successfully, but these errors were encountered: