Native DOM event type checking error since upgrading to 1.0.3
Native DOM event type checking error. (click, contextmenu, etc.)
[email protected] [email protected] vitejs/[email protected] [email protected] [email protected]
I have deleted and installed yarn.lock + node_modules.
<template>
<div @click="test"></div>
</template>
<script setup lang="ts">
const test = () => {}
</script>
Type '() => void' is not assignable to type 'MouseEvent'.ts(2322)
__VLS_types.ts(107, 56): The expected type comes from property 'click' which is declared here on type 'EventObject<undefined, "click", {}, MouseEvent | undefined>'

Same issue here
I got a similar error like this:

For me it works after pinning @types/node to 18.8.0 (+removing lockfile and reinstall deps).
Same thing but when using vue-tsc from the console

For me it works after pinning
@types/nodeto18.8.0(+removing lockfile and reinstall deps).
Wow, it works. Thank you very much.
For me it works after pinning
@types/nodeto18.8.0(+removing lockfile and reinstall deps).Wow, it works. Thank you very much.
Also works for me.
@ymy0622 are you sure this is a real solution and not a workaround before fix ?
@ymy0622 I think you should leave this open. It's not really a desired workaround to pin @types/node.
同样的报错信息 __VLS_types.ts(107, 56): 所需类型来自属性 "click",在此处的 "EventObject<undefined, "click", {}, MouseEvent | undefined>" 类型上声明该属性
1.0.3 继续报错,导致 vscode 里面报错,我的build 命令还用了 vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts
导致无法打包,只能把 vue-tsc 去掉
@bjornharrtell I'm trying to do the @types/node hotfix but still doesn't work...
Any idea of how volar / vue-tsc infer DOM typings? or how the __VLS_types.ts file is generated?
I'm stuck because of this 😭
@IagoLast make sure to put "@types/node": "18.8.0" and not "@types/node": "^18.8.0".
Edit: remove node_modules folder and lock file before install again.
@IagoLast make sure to put "@types/node": "18.8.0" and not "@types/node": "^18.8.0". Edit: remove
node_modulesfolder andlockfile before install again.
thanks!
I did that and still does not work 🤔
when u done this , reopen the vscode
@IagoLast make sure to put "@types/node": "18.8.0" and not "@types/node": "^18.8.0". Edit: remove
node_modulesfolder andlockfile before install again.
Still getting the same problem after changing the version of @types/node to 18.8.0 and reinstalling all dependencies (deleting node_modules folder and yarn.lock).
18.8.0 didn't work for me but 18.7.14 did.
Works with @types/[email protected] also.
Please track https://github.com/vuejs/core/pull/6855
We can't fix this problem in language server, but we will have a doctor message to remind user downgrade @types/node to 18.8.0 or update to next vue release.
We can't fix this problem in language server, but we will have a doctor message to remind user downgrade
@types/nodeto 18.8.0 or update to next vue release.
Does it mean that it cannot be solved from vue-tsc?