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.

can't use page.solveRecaptchas() or any other puppeteer-extra functions with TypeScript. Should we document this?

See original GitHub issue

Hi,

If you canā€™t use any puppeteer-extra-specific function (e.g. page.solveRecaptchas), please add the following to your tsconfig.json:

    "include": [
        "./node_modules/puppeteer-extra/*.d.ts",
        "./node_modules/puppeteer-extra-*/*.d.ts",
        "./src"
    ]

Your code needs to be located inside ./src. Adding the include property in your tsconfig.json will ignore the existing exclude property.

It will include ā€œambientā€ typescript files so that the TypeScript compiler (and langage server) can resolve puppeteer-extra types.

I am not sure why I had to do this. Here is my whole tsconfig.json for reference purposes:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "ES2020",
        "strictFunctionTypes": true,
        "moduleResolution": "node"
    },
    "include": [
        "./node_modules/puppeteer-extra/*.d.ts",
        "./node_modules/puppeteer-extra-*/*.d.ts",
        "./src"
    ]
}

I can create a wiki page if you think that it is appropriate, let me know and Iā€™ll resort to my best english skill to create it šŸ˜ƒ.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
berstendcommented, Jan 14, 2021

@prescience-data thanks!

Je tā€™en prie, non!! šŸ™ˆ

Jā€™ai bien peur šŸ™ˆ

1reaction
prescience-datacommented, Jan 13, 2021

@berstend Added some info on adding to ambient types:

https://github.com/berstend/puppeteer-extra/wiki/TypeScript-usage

@clouedoc

Nowadays, I resort to massive use of // @ts-ignore, mostly because Iā€™m too lazy to find the root cause.

Je tā€™en prie, non!! šŸ™ˆ

Read more comments on GitHub >

github_iconTop Results From Across the Web

puppeteer-extra-plugin-recaptcha - npm
A puppeteer -extra plugin to solve reCAPTCHAs and hCaptchas automatically.. Latest version: 3.6.6, last published: 6 months ago. Start using ...
Read more >
puppeteer-extra-plugin-recaptcha doesn't work on crunchyroll ...
From the terminal response, it seems the plug in was unable to detect or solve the captcha. The Tidal login page does use...
Read more >
Puppeteer error: An `executablePath` or `channel` must be ...
It seems like puppeteer-core now requires executablePath as mandatory. Try this: import bypass from './captcha/captchaBypasser.js'; importĀ ...
Read more >
Puppeteer-extra NPM - npm.io
Solves reCAPTCHAs and hCaptchas automatically, using a single line of code: page.solveRecaptchas() . puppeteer-extra-plugin-adblocker. Very fast & efficientĀ ...
Read more >
Web Scraping with a Headless Browser: A Puppeteer Tutorial
In this article, Toptal Freelance JavaScript Developer Nick Chikovani shows how easy it is to perform web scraping using a headless browser.
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