Skip to content

Commit

Permalink
Fix test hydration check in Safari 10.1 (#40285)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ijjk committed Sep 6, 2022
1 parent d53e2f2 commit e8ff273
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/lib/next-webdriver.ts
Expand Up @@ -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()
Expand Down

0 comments on commit e8ff273

Please sign in to comment.