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

[Bug]: Error with missing structuredClone API in Node 16 when doing a screenshot #11004

Closed
2 tasks
ArnaudBuchholz opened this issue Sep 22, 2023 · 4 comments · Fixed by #11006
Closed
2 tasks

Comments

@ArnaudBuchholz
Copy link

ArnaudBuchholz commented Sep 22, 2023

Minimal, reproducible example

import puppeteer from 'puppeteer'; // TS/ESM are all supported.

global.structuredClone = function () {
  throw Error('Use of structuredClone (which does not exist in Node 16)');
};

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  const result = await page.screenshot();
  console.log(result);
  await browser.close();
})();

Error string

Use of structuredClone (which does not exist in Node 16)

Bug behavior

  • Flaky
  • PDF

Background

https://developer.mozilla.org/en-US/docs/Web/API/structuredClone#browser_compatibility

Expectation

The code was working (puppeteer@20) but it recently broke.

Reality

I know Node 16 is on the verge of being deprecated but I didn't see any breaking change telling it is no more supported.

Puppeteer configuration file (if used)

No response

Puppeteer version

21.3.3

Node version

16.20.2

Package manager

npm

Package manager version

8.19.4

Operating system

Windows

@github-actions
Copy link

This issue has an invalid Node.js version: 16. Versions must follow SemVer formatting. Please update the form with a valid version.


Analyzer run

@jrandolf jrandolf self-assigned this Sep 22, 2023
@ArnaudBuchholz
Copy link
Author

Updated Node.js version to 16.20.2 (lts/gallium)

@OrKoN
Copy link
Collaborator

OrKoN commented Sep 22, 2023

Looks like an accidental change slipped in but we will drop Node 16 support probably next week, the PR is in progress #10912

@ArnaudBuchholz
Copy link
Author

That was fast, thank you !

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

Successfully merging a pull request may close this issue.

3 participants