Skip to content

Upgrade puppeteer to version 25 #3520

Closed

Description

@mtrezza

New Feature / Enhancement Checklist

Current Limitation

Parse Dashboard uses puppeteer 24.43.1 in the e2e test src/lib/tests/e2e/dashboard.e2e.test.js and in browser control (Parse-Dashboard/browser-control/). Puppeteer 24 can't install Chrome on Node.js 24.16.0 and later or on Node.js 26.1.0 and later. Its postinstall script stops unpacking the Chrome archive without an error, so npm ci succeeds, but launching the browser then fails with Could not find Chrome (ver. …), and a later install into the same cache fails with Failed to set up chrome v…!, see puppeteer/puppeteer#14957 and puppeteer/puppeteer#15071. CI doesn't hit this yet, because its test matrix uses Node.js 24.1.0, but the Node 26 job that #3519 proposes, with Node.js 26.13.0, would. Puppeteer 25 fixes this by unpacking the browser with the operating system's archive tools instead of extract-zip (puppeteer/puppeteer#14960).

Puppeteer is a dev dependency, so this doesn't affect installations of Parse Dashboard or its Docker image.

#3514 upgrades puppeteer to 25.16.0, but it can't be merged as is, see #3499:

  • Puppeteer 25 requires Node.js 22.12.0 or later, but Parse Dashboard supports Node.js 20 (>=20.19.0 <21.0.0 in engines), and CI tests it on Node.js 20.19.0.
  • Puppeteer 25 is ESM-only (feat!: move packages to ESM only puppeteer/puppeteer#14355), and Jest 30.0.4 can't load it with require(), so the e2e test fails on Node.js 20, 22 and 24 with SyntaxError: Unexpected token 'export'.
  • Browser control uses two APIs that puppeteer 25.0.0 removed, and breaks without an error:

Feature / Enhancement Description

Upgrade puppeteer to version 25 without removing Node.js 20 from engines, because removing it is a breaking change that has to wait for a major release:

  • In the CI test matrix, skip puppeteer's browser download and the e2e test on Node.js 20, as refactor: Bump puppeteer from 24.42.0 to 25.15.0 Parse-SDK-JS#3174 does in the JS SDK. For example, add this step between actions/checkout and npm ci:

    # puppeteer 25 requires Node 22.12+, so skip its browser download and the e2e test on Node 20
    - name: Skip puppeteer
      if: startsWith(matrix.NODE_VERSION, '20.')
      run: |
        echo "PUPPETEER_SKIP_DOWNLOAD=true" >> "$GITHUB_ENV"
        rm src/lib/tests/e2e/dashboard.e2e.test.js
  • Load puppeteer for the e2e test in a custom Jest test environment. Jest loads test environments with Node.js' own require(), which can load ES modules since Node.js 20.19.0 and 22.12.0. For example, testing/puppeteerEnvironment.js:

    const { TestEnvironment } = require('jest-environment-node');
    
    // puppeteer is ESM-only, which Jest's require() can't load. Jest loads test
    // environments with Node.js' require(), which can, so load puppeteer here.
    module.exports = class PuppeteerEnvironment extends TestEnvironment {
      async setup() {
        await super.setup();
        this.global.puppeteer = require('puppeteer');
      }
    };

    Add jest-environment-node to devDependencies with the same version as jest, because the environment requires it directly. The e2e test selects the environment with a /** @jest-environment ./testing/puppeteerEnvironment.js */ docblock and uses globalThis.puppeteer instead of require('puppeteer'). Jest only reads the first comment of a file, so put the docblock above the copyright header. With refactor: Bump puppeteer from 24.43.1 to 25.16.0 #3514 and this change, all test suites pass locally on Node.js 22.19.0, and the e2e test passes on Node.js 22.19.0, 24.11.1 and 26.13.0, with Jest 30.0.4 and 30.5.2.

    These simpler options don't work:

    • Transpiling puppeteer with testing/preprocessor.js, as for marked: the e2e test then times out in waitForSelector.
    • Loading puppeteer with process.getBuiltinModule('node:module').createRequire(__filename)('puppeteer'): this works with Jest 30.0.4, but not with Jest 30.5.0 and later, which route process.getBuiltinModule through Jest's module system (feat(jest-runtime): automock ESM, sandbox the loader escape hatches, and match Node's graph-error ordering jestjs/jest#16391).
    • Upgrading Jest: Jest 30.4.0 and later can load ES modules with require(), but only on Node.js 24.9.0 and later and with --experimental-vm-modules, so not on the Node.js 22 and 24.1.0 jobs.
  • In browser control, replace browser.isConnected() with browser.connected and clickCount: 3 with count: 3; puppeteer 24 supports both replacements too. Browser control loads puppeteer with require('puppeteer') outside of Jest, which works with puppeteer 25 on Node.js 22.12.0 and later, so change its requirement in Parse-Dashboard/browser-control/README.md from Node.js 20.19.0 to 22.12.0.

  • Remove the CI step when Parse Dashboard drops Node.js 20.

Example Use Case

  1. A developer runs the e2e test or uses browser control on Node.js 24.16.0 or later, or on Node.js 26.
  2. Puppeteer installs Chrome, and the e2e test and browser control work.

Alternatives / Workarounds

3rd Party References

Activity

  1. added
    type:feature
    on Oct 31, 2026
  2. parse-github-assistant commented on Oct 31, 2026

    @parse-github-assistant

    🚀 Thanks for opening this issue! We are excited about your ideas for improvement!

  3. parseplatformorg commented on Nov 4, 2026

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 9.3.0-alpha.16

  4. parseplatformorg commented on Nov 4, 2026

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 10.0.0

  5. added
    state:released
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedstate:released-alphatype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions