Bug: No overload matches this call
See original GitHub issueI’m not sure if this is a bug or an issue on my end. This was working previously until an update so.
Demo Project
I have a simple project that I’ve created to reproduce the bug:
https://github.com/3lpsy/testing-vue-class-component-bug
Description
When using the @Component decorator with the components option, I receive the error: No overload matches this call (full error below).
Reproducing
npm install npm run build
Full Error:
ERROR in /home/vanguard/Playground/testcomponent/src/views/Home.vue
12:2 No overload matches this call.
Overload 1 of 2, '(options: ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>> & ThisType<Vue>): <VC extends VueClass<...>>(target: VC) => VC', gave the following error.
Type '{ name: string; props: { msg: StringConstructor; }; }' is not assignable to type '{ [key: string]: VueConstructor<Vue> | FunctionalComponentOptions<any, PropsDefinition<any>> | ComponentOptions<never, any, any, any, any, Record<string, any>> | AsyncComponentPromise<any, any, any, any> | AsyncComponentFactory<...>; }'.
Property 'name' is incompatible with index signature.
Type 'string' is not assignable to type 'VueConstructor<Vue> | FunctionalComponentOptions<any, PropsDefinition<any>> | ComponentOptions<never, any, any, any, any, Record<string, any>> | AsyncComponentPromise<any, any, any, any> | AsyncComponentFactory<...>'.
Overload 2 of 2, '(target: VueClass<Vue>): VueClass<Vue>', gave the following error.
Argument of type '{ components: { name: string; props: { msg: StringConstructor; }; }; }' is not assignable to parameter of type 'VueClass<Vue>'.
Object literal may only specify known properties, but 'components' does not exist in type 'VueClass<Vue>'. Did you mean to write 'component'?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
No overload matches this call. Type 'string' is not ...
This happens when you do not assign your types properly. Your variable data Type MUST match the passing data type ...
Read more >No overload matches this call with styled components ...
No overload matches this call in TypeScript is really annoying and there aren't too many solutions around there, though we have a solution!...
Read more >TS2769: No overload matches this call. · Issue #3485
Describe the bug TS2769: No overload matches this call. Overload 1 of 2, '(props: ListItemTitleProps, context?: any): ReactElement<any, any> | ...
Read more >No overload matches this call when trying to use array. ...
I have a starting state like this: const characters = "this is a test".split("").map(character => ({ character, currentClasses: ["correct"…
Read more >"No overload matches this call" - Airtable Community
I am trying to use createrecordsasync but am getting this error: “No overload matches this call” All the parameter types are correct.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@3lpsy would you please show that test repo you had? I have the same problem and still can’t figure out what I’m doing wrong.
Your
components
option is wrong. It should be an object. Please, next time consider using forum, chat room or Stack Overflow to ask your question especially you are not sure if it is a bug or not. Thank you.