undefined is not an object (evaluating 'window.webkit.messageHandlers')

See original GitHub issue

One of my clients received this error: undefined is not an object (evaluating 'window.webkit.messageHandlers')

It seems to be thrown somewhere here: Screenshot 2020-11-09 at 16 38 08

According to the breadcrums the error was thrown right before sending data to yandex analytics webvisor. I guess, it might be the reason, but I am not sure. Screenshot 2020-11-09 at 16 47 24

I use sentry 5.27.2. It’s not the newest, but it seems that 5.27.3 has nothing to do with the problem I described. If possible, let me know how I can prevent it, thanks 😇

JSON of the error: Uploading sentry_json_review.zip…

Link: https://sentry.io/share/issue/2d981382a8a142ac8cd93a50e1ef8b62/

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:22
  • Comments:27 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
padinkocommented, Mar 11, 2021

just opening next html in edge for iOS will create this issue

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<button type="button">test</button>
<script
        src="https://browser.sentry-cdn.com/6.2.2/bundle.min.js"
        integrity="sha384-SEu4bJkpht31dkOz4nRcKDxnisSU+Jc8WRSOnBSZJ2yVMlbk4sAKQSrBw6qBVzKR"
        crossorigin="anonymous"
></script>
<script>
Sentry.init({
    dsn: '__INSERT_DSN_URL__',
    release: '0.0.1',
});
document.querySelector('button').addEventListener('click', (event) => {
    event.preventDefault();
    alert(':)');
    banana();
});
</script>
</body>
</html>
5reactions
bendavis78commented, Mar 15, 2021

Can also confirm. Getting this error for Chrome Mobile on iOS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - javascript on loaded page finds window.webkit is undefined
The window.webkit namespace only appears in webview with script message handlers. ... undefined is not an object (evaluating 'window.webkit.
Read more >
why is window.webkit undefined in … | Apple Developer Forums
window.webkit.messageHandlers.NAME.postMessage('hello from javascript running in the hosted page!');. I've added code at the app like: [wbConfig.
Read more >
Error in MS Edge iOS app while trying to upload a file.
TypeError: undefined is not an object (evaluating 'window.webkit.message-Handlers.logjsMessage.postMessage'). Not sure where it is coming.
Read more >
JavaScript Manipulation on iOS Using WebKit - Medium
This object injects JavaScript using addUserScript(_:) and listens to message handlers ... object, your web view will define a new function window.webkit.
Read more >
iOS 8.3 - TypeError: undefined is not an object (evaluating ...
iOS 8.3 - TypeError: undefined is not an object (evaluating 'window.webkit.messageHandlers') · Details · Description · Attachments · Attachments.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found