#14784·meteor

[3.5.2] error in boot.js __dirname is already declared when using latest puppeteer

Author: jankapunktCreated Sep 23, 2026Updated Sep 23, 2026

When running tests in Meteor (3.5.2) using the latest puppeteer (25.11.0) there is no way to boot the test application. I also checked, this also applies to 3.4 and also to package tests that use a bare Meteor project as test-proxy.

Reproduction:

bash
meteor create dirnamefail
cd dirnamefail/
meteor npm install --save-dev puppeteer
meteor add meteortesting:mocha
TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=meteortesting:mocha
[[[[[ Tests ]]]]]                             

=> Started proxy.                             
=> Started HMR server.                        
=> Adding gitignore entries for Meteor Modern-Tools build context directories: */build-assets*, */build-chunks*
=> Added gitignore entries for Meteor Modern-Tools build context directories    
=> Started MongoDB.                           
error on boot.js packages/modules.js:57416    
const __dirname = fileURLToPath(import.meta.url);
      ^

SyntaxError: Identifier '__dirname' has already been declared
    at new Script (node:vm:117:7)
    at createScript (node:vm:269:10)
    at Object.runInThisContext (node:vm:317:10)
    at /tools/static-assets/server/boot.js:414:32
    at /tools/static-assets/server/boot.js:502:11
    at Profile.run (/tmp/meteor-test-run78ifyu.birf2/.meteor/local/build/programs/server/tools/tool-env/profile.ts:651:14)
    at startServerProcess (/tools/static-assets/server/boot.js:501:17)
    at Object.<anonymous> (/tools/static-assets/server/boot.js:506:2)
    at Object.<anonymous> (/tools/static-assets/server/boot.js:510:4)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1830:14)
packages/modules.js:57416
const __dirname = fileURLToPath(import.meta.url);
      ^

SyntaxError: Identifier '__dirname' has already been declared
    at new Script (node:vm:117:7)
    at createScript (node:vm:269:10)
    at Object.runInThisContext (node:vm:317:10)
    at /tools/static-assets/server/boot.js:414:32
    at /tools/static-assets/server/boot.js:502:11
    at Profile.run (/tmp/meteor-test-run78ifyu.birf2/.meteor/local/build/programs/server/tools/tool-env/profile.ts:651:14)
    at startServerProcess (/tools/static-assets/server/boot.js:501:17)
    at Object.<anonymous> (/tools/static-assets/server/boot.js:506:2)
    at Object.<anonymous> (/tools/static-assets/server/boot.js:510:4)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1830:14)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
=> App didn't exit 3000ms after SIGTERM; sending SIGKILL.

Using a significantly older version of puppeteer (for example [email protected]) does not cause this issue and therefore isolates the problem to newer versions of puppeeter supposedly messing with __dirname somehow.