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

Cannot read property '__disableEmitter' of undefined #1168

Closed
shqyking opened this issue Mar 30, 2021 · 2 comments
Closed

Cannot read property '__disableEmitter' of undefined #1168

shqyking opened this issue Mar 30, 2021 · 2 comments
Labels
Status: Review Needed Request for review comments

Comments

@shqyking
Copy link

First of all, I apologize that I cannot provide a reproduction link. I am not able to reproduce the issue without the complex setup of the project that I work on. I will try my best to describe the problem and hope someone can give me some hints or point some direction.

The issue happened when I use Ant Design Vue Table component with the "slot" functionality. Inside the slot I put a component(let's call it component A) to render the content I want. So far so good. Then I click some button to go to a new page. Components of old page start to unmount, and I see the error below

Uncaught (in promise) TypeError: Cannot read property '__disableEmitter' of undefined
    at Proxy.beforeUnmount (vue-i18n.esm-bundler.js?47e2:1672)
    at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:154)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?5c40:163)
    at Array.hook.__weh.hook.__weh (runtime-core.esm-bundler.js?5c40:1934)
    at invokeArrayFns (shared.esm-bundler.js?6690:470)
    at unmountComponent (runtime-core.esm-bundler.js?5c40:4769)
    at unmount (runtime-core.esm-bundler.js?5c40:4679)
    at unmountChildren (runtime-core.esm-bundler.js?5c40:4809)
    at unmount (runtime-core.esm-bundler.js?5c40:4700)
    at unmountChildren (runtime-core.esm-bundler.js?5c40:4809)

The error stack trace shows it happens to beforeUnmount hook of the component A inside the slot. I tried to use different components to make sure it's not the problem of a specific component A. It turns out that no matter what component A is, the error always occurs. In addition, if I use native html element like <div> or <label>, no error occurs(this makes sense as those elements are not Vue components)

Looked at the complied vue-i18n file, "_vueI18n" is undefined, on line 1672 of screenshot attached. Maybe quick fix is to check "_vueI18n" before access its "__disableEmitter" property?

I suspect the root cause is something that I am even not aware of. At the moment, any help will be helpful.

Stack trace:
Screen Shot 2021-03-30 at 6 06 21 PM

Error position in complied vue-i18n file:
Screen Shot 2021-03-30 at 5 53 47 PM

@shqyking shqyking added the Status: Review Needed Request for review comments label Mar 30, 2021
@kazupon
Copy link
Owner

kazupon commented Mar 30, 2021

Thank you for your reporting!
This is vue-i18n v9 issue, and this is the same issue.
intlify/vue-i18n#412

Please, check it!
Thanks!

@gogoinga
Copy link

gogoinga commented Apr 9, 2021

老哥,知道是什么原因引起了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

3 participants