Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping a computed in readonly() causes console warnings and breaks the computed's functionality #3376

Closed
LinusBorg opened this issue Mar 6, 2021 · 0 comments
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working scope: reactivity

Comments

@LinusBorg
Copy link
Member

Version

3.0.7

Reproduction link

https://codesandbox.io/s/admiring-mendel-pgnty?file=/src/App.vue

Steps to reproduce

  1. Open the Sandbox link
  2. Check console and see readonly warnings
  3. Read explanation in App.vue or below

What is expected?

  1. No warnings about readonly properties
  2. computed logging true to the console

What is actually happening?

  1. Warning about readonly properties _value & _dirty being set
  2. computed stops working, longs undefined

reading the value from the readonly-computed causes console warnings about
setting readonly properties _value && _dirty - however, those are internal properties of the computed implementation
and need to be allowed to be set.

This also breaks the computed itself, as it can no longer be marked as dirty or update its computed value - that's why it logs undefined to the console instead of true

Already working on a PR

@LinusBorg LinusBorg added 🐞 bug Something isn't working scope: reactivity ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Mar 6, 2021
@LinusBorg LinusBorg self-assigned this Mar 6, 2021
@LinusBorg LinusBorg removed their assignment Mar 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working scope: reactivity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant