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

_vueI18n can be undefined and throw error in __DEV__ #476

Closed
m0ksem opened this issue Apr 23, 2021 · 3 comments
Closed

_vueI18n can be undefined and throw error in __DEV__ #476

m0ksem opened this issue Apr 23, 2021 · 3 comments

Comments

@m0ksem
Copy link

m0ksem commented Apr 23, 2021

Module versions (please complete the following information):

  • vue: 3.0.5
  • vue-i18n: 9.1.6

Reproduction Link
https://github.com/m0ksem/vue-i18n-render-error

Look at List.vue component. It renders the Separator component from the slot, where $i18n = undefined for some reason.

Probably you need to add a simple undefined check.

Screenshots
Current behavior
image

Probably you should just check for undefined.

const _vueI18n: VueI18nInternal<
          Messages,
          DateTimeFormats,
          NumberFormats
        > = this.$i18n
        if (_vueI18n) {
          _vueI18n.__disableEmitter && _vueI18n.__disableEmitter()
        }
        
        delete this.$el.__VUE_I18N__
      }

in packages/vue-i18n/src/mixin.ts:133

@m0ksem m0ksem added the Status: Review Needed Request for review comments label Apr 23, 2021
@kazupon
Copy link
Member

kazupon commented Apr 23, 2021

related #412
I think that issue is same!

@kazupon kazupon removed the Status: Review Needed Request for review comments label Apr 23, 2021
@m0ksem
Copy link
Author

m0ksem commented Apr 23, 2021

Yes. The error message looks different, but it is the same issue.

I still get this issue. I upgraded Vue to 3.0.11 in the reproduction repo. So #412 should be reopened.

@kazupon
Copy link
Member

kazupon commented Apr 24, 2021

I checked your repro codes and debugged your code.

I think this is bug of Vue
I have confirmed that the beforeUnmount occurs twice in your code as well.

I hope You should send an issue to vue-next along with your code.

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

No branches or pull requests

2 participants