puppeteer: [Bug]: SyntaxError: Unexpected token '??='

Minimal, reproducible example

const puppeteer = require("puppeteer");

(async () => {
	// Launch the browser and open a new blank page
	const browser = await puppeteer.launch({
		product: "firefox",
		headless: false,
	});
	const page = await browser.newPage();

	// Navigate the page to a URL
	await page.goto("https://facebook.com/login.php");

	// Set screen size
	// await page.setViewport({ width: 1080, height: 1024 });

	// Type into search box
	// await page.type(".search-box__input", "automate beyond recorder");

	// Wait and click on first result
	// const searchResultSelector = ".search-box__link";
	// await page.waitForSelector(searchResultSelector);
	// await page.click(searchResultSelector);

	await browser.close();
})();

Error string

error on first run

Bug behavior

  • Flaky
  • PDF

Background

i just install puppeteer then write sample script from the readme.md

Expectation

just trying

Reality

d:\Workspaces\Kotlin\Android\bot\facebot\bot\node_modules\puppeteer-core\lib\cjs\puppeteer\util\disposable.js:19
Symbol.dispose ??= Symbol('dispose');
               ^^^

SyntaxError: Unexpected token '??='
    at wrapSafe (internal/modules/cjs/loader.js:1029:16)
    at Module._compile (internal/modules/cjs/loader.js:1078:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (d:\Workspaces\Kotlin\Android\bot\facebot\bot\node_modules\puppeteer-core\lib\cjs\puppeteer\common\EventEmitter.js:23:25)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)

Puppeteer configuration file (if used)

const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  // Changes the cache location for Puppeteer.
  cacheDirectory: join(__dirname, '.cache'),
};

Puppeteer version

^21.3.6

Node version

v14.21.3

Package manager

yarn

Package manager version

3.6.3

Operating system

Windows

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 21 (1 by maintainers)

Most upvoted comments

This issue has an unsupported Node.js version: 14.21.3. Only versions above v16.3.0 are supported. Please verify the issue on a supported version of Node.js and update the form.


Analyzer run