Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: o is not defined #514

Closed
yoyo837 opened this issue Jan 15, 2018 · 31 comments
Closed

Uncaught ReferenceError: o is not defined #514

yoyo837 opened this issue Jan 15, 2018 · 31 comments
Labels

Comments

@yoyo837
Copy link

yoyo837 commented Jan 15, 2018

When simulating mobile devices...Long press a button, tools report error about a second later.

Edit: Or right click and it immediately report the error

    document.addEventListener("contextmenu", t=>{
        const n = t.target;
        if (n) {
            const t = Object(o.a)(n); // here
            if (t)
                return e.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = !0,
                void (e.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = t)
        }
        e.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = null,
        e.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
    }
    )

Version

4.0.0

Browser and OS info

Chrome 63/ Win 10 FCU

Steps to reproduce

1.Long press a button
2.report error

What is expected?

No mistake

What is actually happening?

report error

@Akryum
Copy link
Member

Akryum commented Jan 15, 2018

I can't reproduce this. Also, the code you posted doesn't exist. Here is the compiled code in the extension:

document.addEventListener("contextmenu", t=>{
    let n = t.target;
    if (n) {
        for (; !n.__vue__ && n.parentElement; )
            n = n.parentElement;
        const t = n.__vue__;
        if (t)
            return e.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = !0,
            void (e.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = t)
    }
    e.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = null,
    e.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
}
)

Try to remove and reinstall the extension.

@Akryum Akryum added bug cannot reproduce We cannot reproduce the problem with the given information. More env information needed. labels Jan 15, 2018
@yoyo837
Copy link
Author

yoyo837 commented Jan 15, 2018

d74b732e-e1bb-42a2-a3d7-a150ffafc709
2c42b7f8-bb8e-42c1-beb3-760b7d856e16
0234ba0d-8106-497d-8124-065aeaec9522

I did just try and still happens.

@yoyo837
Copy link
Author

yoyo837 commented Jan 15, 2018

build with this commit: a79d9c5

@yoyo837
Copy link
Author

yoyo837 commented Jan 17, 2018

#525 Possible related issues

@UncleBill
Copy link
Contributor

Got a same issue.

@ibyteyou
Copy link

+1

@f3l1x
Copy link

f3l1x commented Jan 19, 2018

Got the same issue.

Uncaught ReferenceError: o is not defined
    at HTMLDocument.document.addEventListener.t (<anonymous>:1:783)

@ratiw
Copy link

ratiw commented Jan 20, 2018

@Akryum After your fix in #528, I've also seen this, the first time Vue-Devtools is run.

This can now be seen in the same sample here (the same url sample in #528). This seems to happen only the first time Vue-Devtools is initialized.

Steps to reproduce

Sometimes this error pops right away on the page. Sometimes you need to click on the page a few times and it will display the error instead of the rendered content. In one of my project, it displays in the developer tools' console window.

When reloading the page the second time (without closing Vue-devtools), the error is gone.

@Akryum
Copy link
Member

Akryum commented Jan 21, 2018

@ratiw I can't reproduce on the branch.

@ratiw
Copy link

ratiw commented Jan 21, 2018

@Akryum After revisit it again, it actually happens when I "right-click" the window.

Please see the attached gif.

vue-devtools-error

@f3l1x
Copy link

f3l1x commented Jan 21, 2018

Confirmed, mouse right-click trigged it in my Chrome also.

@Loschcode
Copy link

Same issue on my end guys

@TheDutchCoder
Copy link

I have this issue on pages where Vue isn't loaded at all, so not sure why the plugin is listening.

image

@mazinsw
Copy link

mazinsw commented Jan 24, 2018

Same issue here, when right clicked on any page, version tested: 4.1.0

@Akryum Akryum removed the cannot reproduce We cannot reproduce the problem with the given information. More env information needed. label Jan 24, 2018
@tribakzero
Copy link

Seems to be related to the contextual menu that displays the "inspect vue component" with latest Vue.js, I'm installing it and it's fresh, also having the issue.

@anteriovieira
Copy link
Contributor

Fixed in #553

@f3l1x
Copy link

f3l1x commented Jan 24, 2018

@anteriovieira Well, I'm using NWjs (node-webkit) with Vue + Vue DevTools and the error still remains.

@anteriovieira
Copy link
Contributor

@f3l1x, the fix should come in the next version.

@yGuy
Copy link

yGuy commented Jan 25, 2018

You should release that version ASAP. Or even consider disabling the current version of the plugin altogether until you have released that version:
The plugin is breaking other web applications: whenever you right click on them the onerror handler on the window is triggered. Those web apps that report this error (silently or to the user) all look broken, now.
We get lots of reports from the users of our apps regarding this issue. This makes web pages look bad, when in fact it's the vue.js devtools plugin that is badly programmed.
IMHO the plugin should be written with try/catches all over. In case of programming errors the plugin should never trigger the web pages's error handler.

@Akryum
Copy link
Member

Akryum commented Jan 25, 2018

Are your users using the Vue devtools?

@yGuy
Copy link

yGuy commented Jan 25, 2018

As soon as you have a certain user base, there are some among them, who are using it. Do you always disable the plugin when you don't develop with vue? I don't. (or rather: I didn't).
So obviously: yes, some of them have the plugin installed. It doesn't matter whether you are using it. Having it installed seems to be enough.

@Akryum
Copy link
Member

Akryum commented Jan 25, 2018

Until 4.1.1 is out they can disable it then.

@anteriovieira
Copy link
Contributor

anteriovieira commented Jan 25, 2018

@yGuy the error is only thrown when the vue tab is triggered. If the user does not open the devtools and select the vue tab then the error is not related to vue-devtools.

@yGuy
Copy link

yGuy commented Jan 25, 2018

The point is: How do I tell them, that it's not my page that is broken, but its the damn plugin that is totally unrelated? I cannot send an email to all my users and tell them about the plugin. I don't even have their contact data. When will 4.1.1. be out?

@Akryum
Copy link
Member

Akryum commented Jan 25, 2018

@anteriovieira This can happen even if the devtools are not open.

@Akryum
Copy link
Member

Akryum commented Jan 25, 2018

I cannot send an email to all my users and tell them about the plugin. I don't even have their contact data.

Why don't you have any mean of supporting your users?

@Akryum
Copy link
Member

Akryum commented Jan 25, 2018

When will 4.1.1. be out?

Very soon.

@yyx990803
Copy link
Member

4.1.1 has been pushed to chrome web store, it should be live any time.

@candu
Copy link

candu commented Jan 25, 2018

4.1.1 is out, not experiencing this bug anymore on my end (user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36). Thanks for fixing this!

@hackel
Copy link

hackel commented Jan 25, 2018

Thanks for the fix @Akryum! This issue also affected the extension on Firefox and it is now fixed as well.

Please ignore the complainers. Users need to understand that any time they install an extension and grant permission to inject javascript on any page, they are opening 3rd party sites up to breakage. That's not on you at all. Developers should know better.

@f3l1x
Copy link

f3l1x commented Jan 28, 2018

Confirm, it's fixed for my and NW.js environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests