Geet getting 500 internal server error
Unanswered
Basset Hound posted this in #help-forum
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
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
@Basset Hound ⨯ 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
export async function POST(req: Request, { params }: { params: { uid: string } }) {
if (!params) {
throw new Error('Params is undefined');
}
console.log(params.uid);
return Response.json({ message: 'Success.' }, { status: 200 });
}not bug, but params is in second argument