dkfbasel / vuex-i18n

Localization plugin for vue.js 2.0 using vuex as store
MIT License
665 stars 56 forks source link

vuex-i18n 1.10.3 does not work with vuex > 2.5 #62

Closed Loghorn closed 6 years ago

Loghorn commented 6 years ago

Using vuex > 2.5 with the latest vuex-i18n 1.10.3 does not work. The console logs this error: i18n: i18n vuex module is not correctly initialized. Please check the module name: i18n

You can easily reproduce the issue by upgrading the vuex version in the test/index.html page.

The problem relies in the option preserveState: true passed to store.registerModule, because this prevents the creation of the i18n store. Removing the option fixes the issue.

Serhiy-Nazarov commented 6 years ago

https://github.com/dkfbasel/vuex-i18n/commit/a111ca6676893c0ef1647001ad9ee5f766ec9f67#diff-7278dab49dd6e4424f694900f20af101

{ preserveState: true } in registerModule - it's call error

Look this comment for issue https://github.com/vuejs/vuex/issues/1130#issuecomment-356612119

tikiatua commented 6 years ago

Thank you both for clearing this up. I will adapt the code and push a new version as soon as possible.

tikiatua commented 6 years ago

This is fixed in the latest version 1.10.4. Many thanks your your help.