解决编辑器中vue语法报错

364 阅读1分钟

背景

项目背景:vue: ^3.2.38, vue-Offical: 2.x

在编写vue代码的时候,总是报错,报错信息部分如下:

...
"Block-scoped variable '__VLS_8' used before its declaration."
"'__VLS_8' is declared here."
"Variable '__VLS_8' is used before being assigned."
...

每个ts文件末尾都标红,虽然不影响构建,但是看到脑壳疼

image-20240326113754782

image-20240304122102533

解决

应该是vue-offical版本更新频率太高导致的(插件问题)

通过降级解决报错,解决步骤如下

image-20240326114338142

题外话

github上有这个issue,但是好像只能降级解决,官方还没修复

github上的issue