question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: do not mutate vuex store state outside mutation handlers

See original GitHub issue

Hi!

I’m trying to add vuex-multi-tab-state to an existing project and stuck with an error:

Error: do not mutate vuex store state outside mutation handlers

It’s hard to provide a minimal example, but I found a possible cause.

Here it is: https://github.com/gabrielmbmb/vuex-multi-tab-state/blob/0a46afc8f636744493ff0dc95bafd49780f3a49f/src/index.ts#L56

If change to

return mergeWith({}, oldState, newState, mergeCustomizer);

(create a new one object instead of change original)

the error doesn’t happen.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gabrielmbmbcommented, Apr 13, 2020

As you pointed out, the function mergeWith was mutating the store state directly. This is fixed now and v1.0.13 has been released! Thank you again for reporting the issue!

0reactions
jonalxhcommented, Aug 31, 2021

Any update? I’m facing the same issue with Nuxt and vuex-multi-tab-state version ^1.0.16.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vuex - Do not mutate vuex store state outside mutation handlers
Error [vuex] Do not mutate vuex store state outside mutation handlers. What does it mean? It happens when I try to type in...
Read more >
Error: form binding with Vuex - Do not mutate vuex store state ...
The problem I'm seeing is that as soon as the a bound form field changes, it triggers the error: Do not mutate vuex...
Read more >
Vuex - Do not mutate vuex store state outside mutation handlers
Getting error but not find where and why ? vue page.
Read more >
[vuex] Do not mutate vuex store state outside mutation handlers.
I am trying to get the top 5 products in the product array but this code which I am trying to access the...
Read more >
Error: [vuex] Do not mutate vuex store state outside ... - GitHub
I upgrade to the latest version(v1.0.0-rc11),how to handle the error? This question is available on Nuxt.js community (#c1713)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found