We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c10ac68 commit e5eca75Copy full SHA for e5eca75
packages/next/client/components/app-router.tsx
@@ -136,7 +136,8 @@ function Router({
136
// location.href is read as the initial value for canonicalUrl in the browser
137
// This is safe to do as canonicalUrl can't be rendered, it's only used to control the history updates in the useEffect further down in this file.
138
typeof window !== 'undefined'
139
- ? createHrefFromUrl(new URL(window.location.href))
+ ? // window.location does not have the same type as URL but has all the fields createHrefFromUrl needs.
140
+ createHrefFromUrl(window.location as unknown as URL)
141
: initialCanonicalUrl,
142
}
143
}, [children, initialCanonicalUrl, initialTree])
0 commit comments