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: [vuex] do not mutate vuex Table Component

See original GitHub issue

Windows 10 Fire Fox Developer Edition Bootstrap-Vue v2.0.0-rc.11

When we use the component Table with Row details support with Vuex strict, this error is showed:

Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] do not mutate vuex store state outside mutation handlers."

To see this error in console, just click in detail button, using a vuex data by getters in :items of b-table.

JSFiddle

Have one fix or workaround for this? Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
TheoBPcommented, Jan 31, 2019

This happens because the table component is trying to update the Vuex state directly, which is not allowed in strict mode. You would have to use a mutation:

https://jsfiddle.net/t1fzL5s6/

1reaction
TheoBPcommented, Feb 1, 2019

It’s not a workaround though, it’s how vue works. A property needs to be defined in order to be reactive. This is already mentioned in the docs.

Note: _If manipulating the _showDetails property directly on the item data (i.e. not via the toggleDetails function reference), the showDetails propertly must exist in the items data for proper reactive detection of changes to it’s value. Read more about Vue’s reactivity limitations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - "Error: [vuex] do not mutate vuex store state outside ...
It is because you are mutating vuex state outside a mutation . In your store either move the mutating part in a mutation...
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 >
do not mutate vuex store state outside mutation handlers-Vue.js
Coding example for the question vuex error - do not mutate vuex store state outside mutation handlers-Vue.js.
Read more >
[vuex] do not mutate vuex store state outside mutation handlers.
I'm using a q-table to display some data in a table. The data is ... Error: [vuex] do not mutate vuex store state...
Read more >
Vuex - Do not mutate vuex store state outside mutation handlers
You call await this.treeRecord(); in your mounted lifecycle hook, which attributes the state reference to this.data . Then you call this.getTreeSpouse(); which ...
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