Unverified Commit bed983c5 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update URL malformed edge error (#41685)

It seems we weren't showing the related URL in this error which makes
debugging this very hard.
parent 0b921a6b
...@@ -110,7 +110,9 @@ export function validateURL(url: string | URL): string { ...@@ -110,7 +110,9 @@ export function validateURL(url: string | URL): string {
return String(new URL(String(url))) return String(new URL(String(url)))
} catch (error: any) { } catch (error: any) {
throw new Error( throw new Error(
`URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, `URL is malformed "${String(
url
)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,
{ cause: error } { cause: error }
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment