Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

Puppeteer crashes on Symbol.dispose ??= after a deploy to Render or a PM2 server

Your error

Symbol.dispose ??= Symbol('dispose');2 more lines it can show

Fix it fast

Most common cause, 1 of 2

An older Render service never set a Node.js version

Pin a supported version in the repository so every deploy uses it.

Fix
echo "24.22.1" > .node-version
git add .node-version
git commit -m "Pin Node.js for Render"
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

SyntaxError: Unexpected token '??=' at Symbol.dispose in puppeteer-core means the server runs a Node.js far older than Puppeteer supports; Puppeteer 25 needs Node 22.12 or newer. Common reasons: a Render service created before November 2023 still defaults to Node 14.17.0, or PM2 keeps starting apps with the Node it was installed under. Set the version on the host explicitly.

  • Applies to Puppeteer 25.18.1, Node.js 22.12+ and 24.x, Render native Node runtime, PM2 process manager
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Check the Node.js version of the process that crashes, not of your laptop. Put the version print in front of the start command on the host, deploy, and read the first log line.

Run this first
node -p "process.version + ' ' + process.execPath" && node index.js

Then find the line you see in this list and open its fix:

  1. 1An older Render service never set a Node.js versionThe log prints v14.17.0 on Render, and the repo has no NODE_VERSION variable, .node-version, .nvmrc or engines field
  2. 2PM2 still runs apps with the Node.js it started undernode -v in an SSH session shows 22 or 24, yet the crash trace runs through a global pm2 folder such as /usr/lib/node_modules/pm2

What does the error look like?

  • Symbol.dispose ??= Symbol('dispose');
  • SyntaxError: Unexpected token '??='
  • node_modules/puppeteer-core/lib/cjs/puppeteer/util/disposable.js

Cause 1 of 2

An older Render service never set a Node.js version

You seeThe log prints v14.17.0 on Render, and the repo has no NODE_VERSION variable, .node-version, .nvmrc or engines field

Check

On Render, the Unexpected token '??=' crash appears when a service with no pinned version falls back to an old default runtime. Render picks the default Node.js from the date a service was created: services from before 1 November 2023 get 14.17.0, while new ones get 24.22.1. Puppeteer's system requirements ask for Node 22.12 or later.

Check
cat .node-version .nvmrc 2>/dev/null; grep -A2 '"engines"' package.json

Fix

Pin a supported version in the repository so every deploy uses it. Render reads the NODE_VERSION environment variable first, then .node-version, then .nvmrc, then the engines range in package.json. Redeploy after committing the file.

Fix
echo "24.22.1" > .node-version
git add .node-version
git commit -m "Pin Node.js for Render"

Verify

The next deploy log prints v24 from the first-step command and Puppeteer loads without the SyntaxError.

Verify
node -p process.version

Confirmed by render.com

Did this fix it?

Cause 2 of 2

PM2 still runs apps with the Node.js it started under

You seenode -v in an SSH session shows 22 or 24, yet the crash trace runs through a global pm2 folder such as /usr/lib/node_modules/pm2

Check

A Puppeteer maintainer notes that this SyntaxError points to Node 16 or earlier and asks reporters to confirm PM2 is not using its own older Node. The PM2 daemon keeps the runtime it was launched with, so upgrading Node in the shell does not change it.

Check
which node && node -v && which pm2

Fix

Reinstall PM2 with the new Node, reload the running daemon, and regenerate the boot script, as the PM2 update guide describes for a Node.js upgrade.

Fix
npm install pm2 -g
pm2 update
pm2 unstartup
pm2 startup

Verify

Restart the app; its log shows the new Node version and the page renders.

Verify
pm2 logs --lines 20

Confirmed by pm2.keymetrics.io

Did this fix it?

How do I stop it coming back?

  • Commit a .node-version or .nvmrc file with an exact Node.js version, so hosts never fall back to their own default.
  • Add "engines": { "node": ">=22.12" } to package.json when the app depends on Puppeteer 25.
  • After any Node.js upgrade on a PM2 server, run pm2 update and recreate the startup script in the same change.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex, Workforce, QistLock.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.