Next.js Discord

Discord Forum

Geet getting 500 internal server error

Unanswered
Basset Hound posted this in #help-forum
Open in Discord
Basset HoundOP
⨯ Error: Params is undefined
at POST (webpack-internal:///(rsc)/./app/api/test/[uid]/route.ts:7:15)

export async function POST({ params }: { params: { uid: string } }) {
if (!params) {
throw new Error('Params is undefined');
}

console.log(params.uid);

return Response.json({ message: 'Success.' }, { status: 200 });
}

http://localhost:3000/api/test/HFsdjfsjihfis

Is this a bug in nextjs? I clearly pass a uid

2 Replies

not bug, but params is in second argument