question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: No overload matches this call

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
vegerotcommented, Mar 12, 2020

@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.

1reaction
ktsncommented, Nov 5, 2019

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.

@Component({ 
  components: {
    HelloWorld
  } 
})
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found