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

Fix test hydration check in Safari 10.1 (#40285)

This removes the optional chaining inside of the `executeAsync` as that
is treated literally when passed to the browser and Safari 10.1 doesn't
support optional chaining.

fixes:
https://github.com/vercel/next.js/runs/8213273664?check_suite_focus=true
fixes:
https://github.com/vercel/next.js/runs/8213237056?check_suite_focus=true
parent d53e2f2f
...@@ -118,7 +118,8 @@ export default async function webdriver( ...@@ -118,7 +118,8 @@ export default async function webdriver(
if ( if (
document.documentElement.innerHTML.indexOf('__NEXT_DATA__') === -1 && document.documentElement.innerHTML.indexOf('__NEXT_DATA__') === -1 &&
// @ts-ignore next exists on window if it's a Next.js page. // @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') console.log('Not a next.js page, resolving hydrate check')
callback() callback()
......
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