Vuex: Vuex breaks with Vue 3.x upgrade

Created on 19 Feb 2020  路  2Comments  路  Source: vuejs/vuex

Version

3.1.2

Reproduction link

https://github.com/blacksonic/todoapp-vue/tree/vue3

Steps to reproduce

vue add vue-next
try to use the Vuex plugin on the instance returned from createApp

What is expected?

Vuex plugin added to the app instance

What is actually happening?

The app breaks with console error:

vuex.esm.js?2f62:7 Uncaught TypeError: Cannot read property 'split' of undefined
at applyMixin (vuex.esm.js?2f62:7)
at Object.install (vuex.esm.js?2f62:824)
at Object.use (runtime-core.esm-bundler.js?5c40:1709)
at eval (main.js?56d7:8)
at Module../src/main.js (app.js:1246)
at __webpack_require__ (app.js:786)
at fn (app.js:151)
at Object.1 (app.js:1356)
at __webpack_require__ (app.js:786)
at checkDeferredModules (app.js:46)


Which leads to the point where it tries to determine the Vue version from the global Vue instance, which is non-existent.

var version = Number(Vue.version.split('.')[0]);
Any suggestions on how to add Vuex to Vue 3 projects?
There is an exported variable in Vue 3 called version.

Most helpful comment

Yea Vuex 3 doesn't work with Vue 3. We're currently working on Vue 3 compatible version of Vuex so stay tuned! At the moment, there's no easy way to use Vuex 3 on Vue 3.

All 2 comments

Yea Vuex 3 doesn't work with Vue 3. We're currently working on Vue 3 compatible version of Vuex so stay tuned! At the moment, there's no easy way to use Vuex 3 on Vue 3.

Will closing the issue since we've release Vuex 4.0.0-alpha.1 which supports Vue 3. Please let us know if there's anything not working with Vuex 4 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbana picture mbana  路  3Comments

taoeffect picture taoeffect  路  3Comments

gdelazzari picture gdelazzari  路  3Comments

weepy picture weepy  路  3Comments

niallobrien picture niallobrien  路  3Comments