Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with puppeteer v10 #33

Closed
crpc opened this issue Jun 18, 2021 · 1 comment · Fixed by #34
Closed

Compatibility with puppeteer v10 #33

crpc opened this issue Jun 18, 2021 · 1 comment · Fixed by #34
Labels

Comments

@crpc
Copy link

crpc commented Jun 18, 2021

Hi,

Puppeteer 10 turns out to be incompatible with types defined in Mockiavelli (PuppeteerController.ts file). When both are used in project, following TypeScript error is shown:

TS2345: Argument of type 'Page' is not assignable to parameter of type 'BrowserPage'. 
Type 'Page' is not assignable to type 'PuppeteerPage'. 
Types of property 'on' are incompatible. 
Type '<K extends keyof PageEventObject>(eventName: K, handler: (event: PageEventObject[K]) => void) => EventEmitter' is not assignable to type '(eventName: "request", handler: (e: PuppeteerRequest) => void) => any'. 
Types of parameters 'handler' and 'handler' are incompatible. 
Types of parameters 'e' and 'event' are incompatible. 
Type 'HTTPRequest' is not assignable to type 'PuppeteerRequest'. 
The types returned by 'method()' are incompatible between these types. 
Type 'string' is not assignable to type '"GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "OPTIONS"'.

Probably method() function return type should be widened to string to match type defs in Puppeteer

Fiszcz added a commit to Fiszcz/mockiavelli that referenced this issue Jun 21, 2021
Fiszcz added a commit that referenced this issue Jun 22, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 1.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant