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

Closed
opened 2022-07-15 17:01:19 +00:00 by andreymal · 6 comments
Contributor

When editing some fields (including but not limited to: priority, date, progress, assignees) from the Kanban view (i.e. via task-detail-view-modal), the following error occurs:

Error: [vuex] do not mutate vuex store state outside mutation handlers.
    assert vuex.esm-bundler.js:83
    enableStrictMode vuex.esm-bundler.js:347
    // ...
    select multiselect.vue:294
    onClick multiselect.vue:47
    node_modules chunk-KQJ3BTR7.js:8799
    // ...
    node_modules chunk-KQJ3BTR7.js:1423
    // ...
    findLabel editLabels.vue:92
    // ...
    searchTimeout multiselect.vue:268
    setTimeout handler*search multiselect.vue:267
    // ...
    1 multiselect.vue:28

or:

Error: [vuex] do not mutate vuex store state outside mutation handlers.
    assert vuex.esm-bundler.js:83
    enableStrictMode vuex.esm-bundler.js:347
    // ...
    2 TaskDetailView.vue:44
    // ...
    updateData prioritySelect.vue:47
When editing some fields (including but not limited to: priority, date, progress, assignees) from the Kanban view (i.e. via `task-detail-view-modal`), the following error occurs: ``` Error: [vuex] do not mutate vuex store state outside mutation handlers. assert vuex.esm-bundler.js:83 enableStrictMode vuex.esm-bundler.js:347 // ... select multiselect.vue:294 onClick multiselect.vue:47 node_modules chunk-KQJ3BTR7.js:8799 // ... node_modules chunk-KQJ3BTR7.js:1423 // ... findLabel editLabels.vue:92 // ... searchTimeout multiselect.vue:268 setTimeout handler*search multiselect.vue:267 // ... 1 multiselect.vue:28 ``` or: ``` Error: [vuex] do not mutate vuex store state outside mutation handlers. assert vuex.esm-bundler.js:83 enableStrictMode vuex.esm-bundler.js:347 // ... 2 TaskDetailView.vue:44 // ... updateData prioritySelect.vue:47 ```
Member

Can you reproduce this on https://try.vikunja.io ?
Which version are you running on?

Can you reproduce this on https://try.vikunja.io ? Which version are you running on?
Author
Contributor

@dpschen i use the git main branch with yarn serve

But your question made me check yarn build and I noticed that the compiled frontend does not have this error, hence try.vikunja.io does not have this error either.

Does it mean this is a bug somewhere inside the yarn serve implementation?

@dpschen i use the git main branch with `yarn serve` But your question made me check `yarn build` and I noticed that the compiled frontend does not have this error, hence `try.vikunja.io` does not have this error either. Does it mean this is a bug somewhere inside the `yarn serve` implementation?
Member

When using build the error will not be logged. Sometimes there are errors that are minor, so we don't want to annoy the user. In development (aka yarn serve) we want to see every problem.

The vuex issues you are seeing are not minor though. That should never happen.
@konrad Do we have a central place where we track these?

When using build the error will not be logged. Sometimes there are errors that are minor, so we don't want to annoy the user. In development (aka `yarn serve`) we want to see every problem. The vuex issues you are seeing are not minor though. That should never happen. @konrad Do we have a central place where we track these?
dpschen added the
kind/bug
label 2022-07-16 20:23:59 +00:00
Owner

Do we have a central place where we track these?

I don't think we have a place for those yet. Maybe we should just open an issue? Or better yet, fix when they come up?

> Do we have a central place where we track these? I don't think we have a place for those yet. Maybe we should just open an issue? Or better yet, fix when they come up?
Owner

Closing since we migrated to pina since this was opened.

Closing since we migrated to pina since this was opened.
Member

I'm not sure but we might still be doing this.
To be absolutely sure that we do not change outsite of actions (since mutations and actions are unified in pinia) we would need to export only refs wrapped in readonly(). Most stores do that, but not all of them.

I'm not sure but we might still be doing this. To be absolutely sure that we do not change outsite of actions (since mutations and actions are unified in pinia) we would need to export only refs wrapped in `readonly()`. Most stores do that, but not all of them.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikunja/vikunja#1945
No description provided.