3.1.2
https://github.com/blacksonic/todoapp-vue/tree/vue3
vue add vue-next
try to use the Vuex plugin on the instance returned from createApp
Vuex plugin added to the app instance
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.
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 馃憤
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.