Closed Joery-M closed 3 weeks ago
It's caused by #4902 which has been reverted.
@KazariEX hey. In which version has been reverted? I installed the latest of vue-tsc
version 2.1.8
and it doesn't compile the code anymore because every item in the v-for
requires a Reactive
wrapper.
Came here at the exact same time with the same question as @Perdolique. I just upgraded to 2.1.8 and am now getting a bunch of type errors that look to be this issue. The linked PR says it appears in 2.1.8, which doesn't make sense because this issue is filed as being about 2.1.8 as well.
We'll skip 2.1.8, ideally 2.1.9 could be released soon with the issue actually fixed.
@KazariEX hey. In which version has been reverted? I installed the latest of
vue-tsc
version2.1.8
and it doesn't compile the code anymore because every item in thev-for
requires aReactive
wrapper.嘿。哪个版本已经恢复了?我安装了最新的vue-tsc
版本2.1.8
,它不再编译代码,因为v-for
中的每个项目都需要一个Reactive
包装器。
Please fallback to v2.1.6
first.
Ahh, I see the revert. It seems like hasn't been released yet. v2.1.6
works as expected. 👍
Vue - Official extension or vue-tsc version
2.1.8
VSCode version
1.94.2
Vue version
3.5.12
TypeScript version
5.6.3 and 5.7.0-dev.20241026
System Info
package.json dependencies
Steps to reproduce
2.1.8
of theVue - Official
VSCode extensionitem.name.value
is marked as incorrectWhat is expected?
The template for
{{ item.name.value }}
should be correct, since the array is shallow, which means the name property needs to be accessed usingname.value
.What is actually happening?
vue-tsc unwraps the refs inside
items
, meaning that it marksitem.name.value
as incorrect, and only acceptsitem.name
.Link to minimal reproduction
https://github.com/Joery-M/vue-sfc-issue
Any additional comments?
This becomes an issue during assignment, like with
v-model
or inside a callback function, since the value will be replacing the ref, instead of the value inside the ref. This can lead to breaking the application.