-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue 2.7 strictTemplates error #13104
Vue 2.7 strictTemplates error #13104
Comments
@xiaoxiangmoe Seemed to be a vue2 type issue. It doesn't convert emits to props |
@LinusBorg could you help transfer this to vuejs/vue? thanks. |
? Are you GPT? |
Also seeing something similar. modules/src/components/CombinedModal.vue:94:14 - error TS2345: Argument of type '{ props: any; onClose: any; }' is not assignable to parameter of type 'Readonly<Partial<{ [x: number]: string; }> & Omit<Readonly<ExtractPropTypes<string[]>>, DefaultKeys<string[]>>> & Record<...>'.
Type '{ props: any; onClose: any; }' is not assignable to type 'Readonly<Partial<{ [x: number]: string; }> & Omit<Readonly<ExtractPropTypes<string[]>>, DefaultKeys<string[]>>>'.
Types of property 'toString' are incompatible.
Type '() => string' is not assignable to type '(() => string) & string'.
94 <MergeModal @close="onClose" v-bind:props="props"></MergeModal> Don't think I'm really doing anything special. Shim file (removing doesn't seem to change anything): declare module "*.vue" {
import type { DefineComponent } from "vue";
const component: DefineComponent;
export default component;
} Running type checking with {
"extends": "../tsconfig.json",
"include": [
"./types/shims-vue.d.ts",
"./types/vuejs-datepicker.d.ts",
"**/*.js", // required even if we're not directly type checking (see `allowJs` below)
"**/*.ts",
"**/*.vue"
],
"compilerOptions": {
"composite": true,
"allowJs": true, // permits .ts/.vue files we're type checking to import .js files, enabling us to gradually add type checking w/o requiring an all-at-once migration. Worth noting that this is completely distinct from `checkJs`, which tells typescript to actually type check them.
"types": [
"vite/client" // Supports Vite's `import.meta.env`
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
} Inheriting from this config file: {
"compilerOptions": {
// Base options / sensible defaults that we want to pretty universally apply across all of our services
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
} |
It seems like there is a type mismatch between the props defined in HelloWorld.vue and how it is being used in App.vue. You need to make sure that the props passed to the HelloWorld component match the expected props. |
In volar we convert |
https://github.com/xiaoxiangmoe/issue-vue-2.7-on-click-type-error.git
HelloWorld.vue
This error come since vue-tsc 1.7.12
The text was updated successfully, but these errors were encountered: