nextjs api route request.query is undefined
logs:
I followed the docs and req.query should be
{} by default but here is undefined, why?Solution
If you're using the App Router, the req type is
NextRequest, or even just simply Request. query doesn't exist on the requests from App Router.