puppeteer-extra icon indicating copy to clipboard operation
puppeteer-extra copied to clipboard

TypeError: puppeteer.launch(...).then(...) is not a function

Open yogeshGroony opened this issue 1 month ago • 0 comments

When I used the following code I got this error

import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth';
import {executablePath} from 'puppeteer';
puppeteer.use(pluginStealth()) 
puppeteer.launch({ headless:false, executablePath: executablePath() }).then(async browser => { 

version--

    "puppeteer": "^22.10.0",
    "puppeteer-core": "^22.10.0",
    "puppeteer-extra": "^3.3.6",
    "puppeteer-extra-plugin-stealth": "^2.11.2"

Solution

import puppeteer from 'puppeteer-extra';
import pluginStealth from 'puppeteer-extra-plugin-stealth';
import {executablePath} from 'puppeteer';

(async () => {
	await puppeteer.use(pluginStealth());
  // Launch the browser and open a new blank page
  const browser = await puppeteer.launch({ headless:false, executablePath: executablePath() });

yogeshGroony avatar Jun 05 '24 06:06 yogeshGroony