What should I import for URL in "NextResponse.redirect(new URL('/destination', request.url))"?
Unanswered
Bighead carp posted this in #help-forum
Bighead carpOP
hi, does anyone know what should I import for
the documentation does not states what type if
I imported:
but I get:
URL
in NextResponse.redirect(new URL('/destination', request.url))
?the documentation does not states what type if
URL
should I importI imported:
import {URL} from "url";
but I get:
Error [TypeError]: url__WEBPACK_IMPORTED_MODULE_1__.URL is not a constructor
2 Replies
nothing
the
URL
class is a global object