Skip to content

Commit

Permalink
Update link.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
damusnet authored Dec 7, 2020
1 parent a9244d2 commit 19802a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ function prefetch(
as: string,
options?: PrefetchOptions
): void {
if (!router) return
if (typeof window === 'undefined') return
if (typeof window === 'undefined' || !router) return
if (!isLocalURL(href)) return
// Prefetch the JSON page if asked (only in the client)
// We need to handle a prefetch error here since we may be
Expand Down

0 comments on commit 19802a7

Please sign in to comment.