Skip to content

Vuex breaks with Vue 3.x upgrade #1683

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

Closed
sonicoder86 opened this issue Feb 19, 2020 · 2 comments
Closed

Vuex breaks with Vue 3.x upgrade #1683

sonicoder86 opened this issue Feb 19, 2020 · 2 comments

Comments

@sonicoder86
Copy link

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.

@kiaking
Copy link
Member

kiaking commented Feb 26, 2020

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.

@kiaking
Copy link
Member

kiaking commented Mar 30, 2020

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 👍

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