diff --git a/packages/utils/src/requestdata.ts b/packages/utils/src/requestdata.ts index f2ffeaf621a1..0249b7a2b481 100644 --- a/packages/utils/src/requestdata.ts +++ b/packages/utils/src/requestdata.ts @@ -365,7 +365,7 @@ function extractQueryParams( try { return ( req.query || - (typeof URL !== undefined && new URL(originalUrl).search.slice(1)) || + (typeof URL !== 'undefined' && new URL(originalUrl).search.slice(1)) || // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node (deps && deps.url && deps.url.parse(originalUrl).query) || undefined