No overload matches this call with the Youtube API (Typescript).
See original GitHub issueI 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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top 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 >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
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?@timotius02 @rocktimsaikia reading the type definitions, it looks like both
parts
andid
are an array of strings:☝️ this compiles, let me know if there are any issues 👍