I'm currently utilizing the Next.js API route and attempting to retrieve the request parameters:
export const GET = async (req: IncomingMessage) => {
const matchString: String = req.nextUrl.searchParams.get("data")
}
I assume the type of req
is IncomingMessage
(please correct me if I'm mistaken); however, when I attempt to access req.nextUrl
, I receive the error message
Property 'nextUrl' does not exist on type 'IncomingMessage'.
What am I doing wrong, and how can I troubleshoot this issue accordingly?