Puppeteer crashes on Symbol.dispose ??= after a deploy to Render or a PM2 server
Fix it fast
Most common cause, 1 of 2An older Render service never set a Node.js version
Pin a supported version in the repository so every deploy uses it.
echo "24.22.1" > .node-version
git add .node-version
git commit -m "Pin Node.js for Render"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.
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.
node -p "process.version + ' ' + process.execPath" && node index.jsThen find the line you see in this list and open its fix:
- 1An older Render service never set a Node.js version
The log prints v14.17.0 on Render, and the repo has no NODE_VERSION variable, .node-version, .nvmrc or engines field - 2PM2 still runs apps with the Node.js it started under
node -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.
cat .node-version .nvmrc 2>/dev/null; grep -A2 '"engines"' package.jsonFix
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.
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.
node -p process.versionConfirmed by render.com
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.
which node && node -v && which pm2Fix
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.
npm install pm2 -g
pm2 update
pm2 unstartup
pm2 startupVerify
Restart the app; its log shows the new Node version and the page renders.
pm2 logs --lines 20Confirmed by pm2.keymetrics.io
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.