Skip to content

Commit

Permalink
Update URL malformed edge error (#41685)
Browse files Browse the repository at this point in the history
It seems we weren't showing the related URL in this error which makes
debugging this very hard.
  • Loading branch information
ijjk committed Oct 23, 2022
1 parent 0b921a6 commit bed983c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/server/web/utils.ts
Expand Up @@ -110,7 +110,9 @@ export function validateURL(url: string | URL): string {
return String(new URL(String(url)))
} catch (error: any) {
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 }
)
}
Expand Down

0 comments on commit bed983c

Please sign in to comment.