VueJS/Pinia - Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter #10374
Unanswered
K1Pro
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Vue 3.4.19 along with Pinia. A warning shows up in the console and I have narrowed it down to a few reasons. I would like to eliminate this warning in order to ensure that I follow best practices so this doesn't develop into more serious errors.
**Here is the warning I am getting: **
[Vue warn] Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided.
Here are the pieces of code that I suspect are the culprits:
Here is my Pinia store:
When I check the console, this is what it points to:
I appreciate any insight and help with this in advance. thank you.
Here is a link to a live app that shows the warning in the console: https://test.k1pro.net/
I simply tried to isolate the problem and followed the console to the origin of the problem, but I am not sure how to fix the warning or perhaps best-practice in this regard.
Beta Was this translation helpful? Give feedback.
All reactions