stagerightlabs / Vue-Three-Demo

An example of a Vue.js / Three.js integration
https://vuethree.stagerightlabs.com/
MIT License
35 stars 8 forks source link

Error: [vuex] do not mutate vuex store state outside mutation handlers #5

Closed Camil88 closed 2 years ago

Camil88 commented 2 years ago

Hello, I've followed your tutorial thoroughly and wrote similar app in Vue3. The issue is that when I run the app then the following error shows up:

Error: [vuex] do not mutate vuex store state outside mutation handlers

I haven't seen anywhere in your code where you mutate state outside mutation handlers. That's why I don't get it. Has it something to do with Vue3 version?

Extra question: is it possible that you upgrade your code and check if everything work fine in Vue3? I would highly appreciate it.

rydurham commented 2 years ago

Hello! Thanks for reaching out. My guess is that the problem you are seeing is likely due to some difference with Vue 3, but I am not positive about that. I haven't seen that error in my Vue2 version, but that does not mean there are no bugs there to be reckoned with.

It has been on my list to upgrade this project to Vue 3 for some time, but my workload is such that I am not able to give this much priority at the moment. Hopefully someday I will have the time to work through the upgrade.

Camil88 commented 2 years ago

Ok, thank you for your answer.

Camil88 commented 2 years ago

I've asked a question on SO and here is one of the working solutions, just for your future reference: https://stackoverflow.com/questions/71083549/why-do-not-mutate-vuex-store-state-outside-mutation-handlers-error-shows-up/71134357#71134357

rydurham commented 2 years ago

Thank you! I appreciate it.

rydurham commented 2 years ago

Thank you for your help in looking into this problem. I have now attempted an upgrade to Vue3 in PR #6, making use of the technique discussed in your SO post. So far it seems to be working well. I am going to close this issue for now but feel free to reopen if you would like.

Camil88 commented 2 years ago

Great, thanks for all efforts you put into this huge upgrade!