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 (in promise) TypeError: Cannot read property '__disableEmitter' of undefined #412

Closed
mits87 opened this issue Mar 28, 2021 · 14 comments
Labels
Status: Need More Info Lacks enough info to make progress

Comments

@mits87
Copy link

mits87 commented Mar 28, 2021

Hi,

I've just installed the latest version of vue-i18n-next and I have a big problem because it does it work correctly with vue-router. Exactly the same bug like we can find here: #253

Some people suggested to use NODE_ENV=production but I can't do that based on fact I'm using different .env files for different environments. Also based on NODE_ENV I'm attaching some extra functionality. So this is not solution.

Version & libraries:
I'm using these version of libraries:

"dependencies": {
    "@vueuse/core": "^4.6.2",
    "core-js": "^3.9.1",
    "register-service-worker": "^1.7.2",
    "vue": "^3.0.2",
    "vue-i18n": "^9.0.0",
    "vue-router": "^4.0.5",
    "vuex": "^4.0.0"
  },

The behaviour:
When I'm trying to change page (using vue-router) I get those errors:

vue-i18n.esm-bundler.js?47e2:1672 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:1957)
    at invokeArrayFns (shared.esm-bundler.js?9ff4:470)
    at unmountComponent (runtime-core.esm-bundler.js?5c40:4819)
    at unmount (runtime-core.esm-bundler.js?5c40:4731)
    at Object.remove (runtime-core.esm-bundler.js?5c40:5125)
    at unmount (runtime-core.esm-bundler.js?5c40:4755)
    at unmountChildren (runtime-core.esm-bundler.js?5c40:4859)

Screenshot 2021-03-28 at 19 36 04

Someone has still a similar problem?

@mits87 mits87 added the Status: Review Needed Request for review comments label Mar 28, 2021
@kazupon
Copy link
Member

kazupon commented Mar 29, 2021

Thank you for your reporting!

I tried to reproduce this issue.
Unfortunately, I could not reproduce...

The below issue minimul repo:
https://github.com/kazupon/vue-i18n-next-issue-412

I need the component structure information from the App root and the following information for each component to solve this problem.

  • whether use i18n custom block
  • or, whether use i18n options
  • or, not use both

Could you give us the component info and structure, please? 🙏

@kazupon kazupon added Status: Need More Info Lacks enough info to make progress and removed Status: Review Needed Request for review comments labels Mar 29, 2021
@jiangjunfeng98
Copy link

vue 3.0.7 is work

"vue": "3.0.7",
"vue-i18n": "^9.0.0"

@ota-meshi
Copy link
Member

Are you using <teleport>?
If so, it may be related to a bug in vue v3.0.9.
vuejs/core#3497

There is no $i18n property on the second call of beforeUnmount.

@holtwick
Copy link

Oh, @ota-meshi and @jiangjunfeng98 why didn't i see your comments earlier, it could have saved my morning ;) I came to the same conclusions. Vue 3.0.7 works and it is related to <teleport>. See my debug comment here: #133

@mits87
Copy link
Author

mits87 commented Mar 29, 2021

@ota-meshi and @jiangjunfeng98 Yes, I'm using <teleport> in my project and I changed my VUE version to vue 3.0.7 but the problem still exists there 👎

In a few hours I will try to prepare some sandbox version of that problem.

@holtwick
Copy link

@mits87 did you check which version is really installed using npm ls vue? Often it is not corresponding to the one in package.json. Try npm i [email protected] to force update.

@mits87
Copy link
Author

mits87 commented Mar 29, 2021

ohh, you are right. The npm ls vue still displayed 3.0.9.
So it means we are waiting for bug fix from here vuejs/core#3497

@shqyking
Copy link

I encountered same problem and my Vue version is 3.0.7(double checked with npm ls vue). I didn't use <teleport> anywhere in the codebase, but maybe some library that I use is using the <teleport>. kazupon/vue-i18n#1168 above is opened by me.

@ota-meshi
Copy link
Member

It works fine with the newly released vue v3.0.10.

@antonio-wundermart
Copy link

antonio-wundermart commented Apr 20, 2021

We have the same issue, in particular we are using this stack:

  • vite,
  • vue3,
  • primevue (ui framework)
  • vue-i18n.

In the latest versions of Primevue they use heavily teleports, which cause the aforementioned error when we change route.
We solved downgrading primevue to an older version which doesn't rely on teleport, but this is not optimal at all. We are considering to move out from vue-i18n since we want also to start using teleport as well for our components.

@ota-meshi
Copy link
Member

You need to use [email protected] or later.

@antonio-wundermart
Copy link

You need to use [email protected] or later.

Thanks, you are right, I cannot replicate it anymore after upgraded vue and cleaned my caches.

@kazupon
Copy link
Member

kazupon commented Apr 20, 2021

This issue was caused by a bug in Vue. This problem does not occur after [email protected], so it is closed.

Thank you for your feedback!

@ldsenow
Copy link

ldsenow commented May 11, 2022

I am on Vue 3.2.25, however, the issue is still happening.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need More Info Lacks enough info to make progress
Projects
None yet
Development

No branches or pull requests

8 participants