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.

No overload matches this call with the Youtube API (Typescript).

See original GitHub issue

I am getting the following error in a Typescript project while trying to pass a youtube video ID to the list method of youtube_v3.Youtube. Here is the full error:

No overload matches this call.
  Overload 2 of 6, '(callback: BodyResponseCallback<Schema$VideoListResponse>): void', gave the following error.
    Argument of type '{ id: string; part: string; }' is not assignable to parameter of type 'BodyResponseCallback<Schema$VideoListResponse>'.
      Object literal may only specify known properties, and 'id' does not exist in type 'BodyResponseCallback<Schema$VideoListResponse>'.ts(2769)
(parameter) videoID: string
No quick fixes available

Here is the part of the code that gives the error:

...
const oauth2Client = new google.auth.OAuth2({ clientId, clientSecret })
oauth2Client.setCredentials({ refresh_token })

const yt = google.youtube({ auth: oauth2Client, version: 'v3' })
const response = await yt.videos.list({
  id: videoID, // the error apears here when I pass the ID value
  part: 'statistics,snippet',
})

Environment details

  • OS: Ubuntu 20.04.3 LTS x86_64
  • Node.js version: v16.7.0
  • npm version: v7.20.3
  • googleapis version: v92.0.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bcoecommented, Dec 21, 2021

Thanks for the example @rocktimsaikia, I’m not sure when we’ll be able to prioritize this work. But, the reproduction is useful and lets us dig into things.

Could you cast to any for the time being, assuming the method is working?

0reactions
bcoecommented, Jun 7, 2022

@timotius02 @rocktimsaikia reading the type definitions, it looks like both parts and id are an array of strings:

async function main (): Promise<void> {
  const yt = google.youtube({ auth: oauth2Client, version: 'v3' })
  const response = await yt.videos.list({
    id: [videoId], // the error apears here when I pass the ID value
    part: ['statistics', 'snippet']
  })
}

☝️ this compiles, let me know if there are any issues 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

React + TypeScript error: No overload matches this call
No overload matches this call. Overload 1 of 2, '(props: Readonly): TestRow', gave the following error. Type '{ key: number; ...
Read more >
No overload matches this call error in TypeScript | bobbyhadz
The error "No overload matches this call" occurs when we call a function and pass it a parameter that doesn't match any of...
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 >
TypeScript — Node.js - MongoDB
If you use TypeScript, you can specify a type for some classes in the driver. ... No overload matches this call. ... OptionalId...
Read more >
TypeScript errors and how to fix them
error TS2394: This overload signature is not compatible with its implementation signature. Broken Code ❌. The implementation does not match all signatures: 1...
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