-
-
Notifications
You must be signed in to change notification settings - Fork 465
Description
Vue - Official extension or vue-tsc version
vue-tsc: 3.0.1
VSCode version
1.102.1 (Universal)
Vue version
3.5.17
TypeScript version
5.8.3
package.json dependencies
{
"dependencies": {
"vue": "^3.5.17"
},
"devDependencies": {
"typescript": "~5.8.3",
"vue-tsc": "^3.0.1"
}
}
Steps to reproduce
because the Ref
uses the internal declaration 'RefSymbol', it causes a defineExpose error
由于 Ref
使用了内部声明 RefSymbol
, 导致 defineExpose 报错
<script setup lang="ts">
import type { Ref } from 'vue'
defineExpose({ } as Ref<any>);
</script>
because the TemplateRef
uses the internal declaration 'ShallowRefMarker', it causes a defineExpose error
由于 TemplateRef
使用了内部声明 ShallowRefMarker
, 导致 defineExpose 报错
<script setup lang="ts">
import type { TemplateRef } from 'vue'
defineExpose({} as TemplateRef<any>);
</script>
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"composite": true,
"moduleResolution": "bundler",
"module": "ESNext",
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"allowImportingTsExtensions": true,
"noEmit": true,
},
}
even using jsdoc for type annotation will cause errors. since the error message is the same and complicated to reproduce, it was not added
甚至使用 jsdoc 做类型标注也会导致错误。由于错误信息是相同的,而且复现起来比较复杂,所以没有添加进去,
What is expected?
it just uses type derivation, but it causes a vue-tsc error
仅仅是使用了类型推导,但是却导致了 vue-tsc 报错
What is actually happening?
although internal declarations are used, this should not cause vue-tsc to run incorrectly, which is counterintuitive
虽然使用了内部声明,但这不应该导致 vue-tsc 运行出错,这很违反直觉
Link to minimal reproduction
https://github.com/onlymisaky/bug-report-vue-tsc
Any additional comments?
No response