79175749

Date: 2024-11-10 20:41:57
Score: 1
Natty:
Report link

You would get the same error locally by building it with next build.

Route Handlers have a different signature with App Router, see the official docs. If you rely on your response, try awaiting it from the request as follows:

export const POST = async (req: NextRequest) => {
  const data = await req.json();
  const { params } = await data as MyResponse;

  if (!params || !params.action)
    return NextResponse.json({ success: false, message: "Incorrect usage" });

  const action = params.action;
  ...
};
Reasons:
  • Has code block (-0.5):
  • Me too answer (2.5): get the same error
  • High reputation (-1):
Posted by: sm3sher