You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using typescript types from @types/puppeteer
You are missing the frame() method on the ExecutionContext interface that you receive from ElementHandle.executionContext().
But the frame() method exists in the code base and documentation and it works. I am having to cast ExecutionContext to any and then call the frame() method and cast that to Frame, which is not great Typescript
Please include code that reproduces the issue.
const element = await this.page.waitFor('.whatever')
element.executionContext().frame() //this last method frame() is marked as not a property in typescript.
// When I examine the index.d.ts, typescript is correct it is not there
What is the expected result?
There should be a frame() method on the ExecutionContext declaration in typescript as it is in your docs and it works. Should be on the index.d.ts file around line 865.
Should say something like:
/** The class represents a context for JavaScript execution. */
export interface ExecutionContext extends JSEvalable {
frame(): Frame | null; // this is missing
queryObjects(prototypeHandle: JSHandle): Promise;
}
What happens instead?
Typescript throws an error and underlines it.
The text was updated successfully, but these errors were encountered:
Thanks for the bug report. We don't maintain @types/puppeteer and we're currently working on shipping our own built in types (see #6124). So hopefully once we ship that (hopefully in a not-too-distant-future release) this should be resolved.
In the mean time I'm going to mark this as closed as we don't maintain the 3rd party types.
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
Using typescript types from @types/puppeteer
You are missing the frame() method on the ExecutionContext interface that you receive from ElementHandle.executionContext().
But the frame() method exists in the code base and documentation and it works. I am having to cast ExecutionContext to any and then call the frame() method and cast that to Frame, which is not great Typescript
Please include code that reproduces the issue.
// When I examine the index.d.ts, typescript is correct it is not there
What is the expected result?
There should be a frame() method on the ExecutionContext declaration in typescript as it is in your docs and it works. Should be on the index.d.ts file around line 865.
Should say something like:
/** The class represents a context for JavaScript execution. */
export interface ExecutionContext extends JSEvalable {
frame(): Frame | null; // this is missing
queryObjects(prototypeHandle: JSHandle): Promise;
}
What happens instead?
Typescript throws an error and underlines it.
The text was updated successfully, but these errors were encountered: