nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.75k stars 483 forks source link

<i18n-n scope="global"> throws warning [intlify] Not found parent scope. use the global scope #2895

Closed VictorKrasnov closed 7 months ago

VictorKrasnov commented 7 months ago

Environment

Reproduction

Add tag to any page / component.

Describe the bug

throws warning [intlify] Not found parent scope. use the global scope. It's very difficult to test my project because I have a lot of these warnings in the browser console. ### Additional context _No response_ ### Logs _No response_
VictorKrasnov commented 7 months ago

I'm sorry, this html-code example disappeared in issue bug description section: <i18n-n :value="12345" scope="global" />

github-actions[bot] commented 7 months ago

Would you be able to provide a reproduction? 🙏

More info ### Why do I need to provide a reproduction? Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. ### What will happen? If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If `needs reproduction` labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it. ### How can I create a reproduction? We have a couple of templates for starting with a minimal reproduction: 👉 [Reproduction starter (v8 and higher)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/v8) 👉 [Reproduction starter (edge)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/edge) A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as **minimal** as possible. See more details [in our guide](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction). You might also find these other articles interesting and/or helpful: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve)
VictorKrasnov commented 7 months ago

Reproduction: https://stackblitz.com/edit/i18n-n-warning?file=pages%2Findex.vue

BobbieGoede commented 7 months ago

Thanks for reporting and providing a reproduction!

The fix for this has been merged upstream in vue-i18n (#1786) and has been released as well, removing lockfiles before installing will install this latest version, I've updated your reproduction to demonstrate here.

VictorKrasnov commented 7 months ago

Thanks for reporting and providing a reproduction!

The fix for this has been merged upstream in vue-i18n (#1786) and has been released as well, removing lockfiles before installing will install this latest version, I've updated your reproduction to demonstrate here.

Sorry but I updated i18n to 8.0.3 in my project but nothing changed, I still see these warnings. What else should I check?

BobbieGoede commented 7 months ago

If removing lockfiles and reinstalling dependencies doesn't work you may have to also delete node_modules before running npm install. If you haven't pinned vue-i18n in your package.json, @nuxtjs/i18n should install the latest compatible vue-i18n@^9.9.0 version which is vue-i18n@9.11.0 which includes the fix.

If you're still getting the warning with the same usage as the reproduction then you likely have an older version installed.

VictorKrasnov commented 7 months ago

Thank you very much, everything works now.