Computed is not triggered anymore after upgrading vue from 3.2.25 to 3.2.45
Vue version
3.2.45
Link to minimal reproduction
https://codesandbox.io/s/6hrrjp
Steps to reproduce
See reproduction link and VueX plugin in Chrome shows that data is successfully updated. Computed does not trigger!
What is expected?
To pick changes up just like it normally would.
What is actually happening?
Button conditions are only evaluated once.
System Info
System:
OS: Windows 10 10.0.22000
CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics
Memory: 5.80 GB / 27.86 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (108.0.1462.54)
Internet Explorer: 11.0.22000.120
npmPackages:
vue: 3.2.45 => 3.2.45
Any additional comments?
This happened when upgrading Vue from 3.2.25 to 3.2.45. Nothing else was upgraded.
I tried to change the rows
, and it worked fine:
This may relate to the ag-grid-vue3. You can open an issue there.
@zhangzhonghe thanks, yes I suspected that it could also have to do with ag-grid. However, this worked before the Vue update. What I find strange is that Ag-Grid updates it correctly, the Vue plugin shows that it gets in the store successfully. Therefore, it's strange that the computed property does not execute. What could be a reason for computed to not pick up a change that is actually happening?
const rows = computed(() => {
console.log("triggered!");
return store.state.rows;
});
The above computed
dependencies store.state.rows
, so you need to change the store.state.rows
to trigger the computed
rerun. But it is no code to change the store.state.row
in your provided reproduction.
But why did this behavior change from Vue version 3.2.25 to 3.2.45? Normally, it would pick up that change. I find it confusing and I get into problems where upgrading one package leads to issues in another package. I wonder what exactly changed about the reactivity but couldn't find it in the logs.