From 8046b345613487e72c637f34b38504e098663e31 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 6 Sep 2022 11:51:55 -0700 Subject: [PATCH] Fix test hydration check in Safari 10.1 --- test/lib/next-webdriver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lib/next-webdriver.ts b/test/lib/next-webdriver.ts index cdadbcf0cc1d..72fdcb2445aa 100644 --- a/test/lib/next-webdriver.ts +++ b/test/lib/next-webdriver.ts @@ -118,7 +118,8 @@ export default async function webdriver( if ( document.documentElement.innerHTML.indexOf('__NEXT_DATA__') === -1 && // @ts-ignore next exists on window if it's a Next.js page. - typeof (window as any).next?.version === 'undefined' + typeof ((window as any).next && (window as any).next.version) === + 'undefined' ) { console.log('Not a next.js page, resolving hydrate check') callback()