Skip to content

v0.2.52 crashes at startup on Node 18 (declared engines: node >=18) — puppeteer 25 is ESM-only #804

Description

@gkriegspeedbay

Summary

package.json declares "engines": { "node": ">=18.0.0" }, and manifest.template.json declares "runtimes": { "node": ">=18.0.0" }. However, the published v0.2.52 crashes at startup on Node 18, and several dependencies now require Node 20 or 22.

Repro (Node 18.20.8, Windows; the cause is platform-independent)

npm init -y
npm install @wonderwhy-er/desktop-commander@0.2.52   # resolves puppeteer 25.12.0
node node_modules/@wonderwhy-er/desktop-commander/dist/index.js
node_modules/md-to-pdf/dist/index.js:9
const puppeteer_1 = __importDefault(require("puppeteer"));
Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/puppeteer/lib/puppeteer/puppeteer.js ... not supported.

The server exits before answering initialize.

Cause

md-to-pdf@5.2.5 depends on puppeteer: ">=8.0.0", and nothing in DC pins puppeteer. The repo's lockfile has puppeteer 24.34.0, but npx and .mcpb installs don't use the lockfile, so they resolve puppeteer 25.x. Puppeteer 25 is ESM-only and declares engines: node >=22.12.0. md-to-pdf loads it with require(), which fails on Node 18 because Node 18 can't require() ES modules.

What I tested (fresh install with no lockfile, which is the npx/mcpb path)

Node Server start + tools/list md-to-pdf render
18.20.8 ❌ crashes (ERR_REQUIRE_ESM) ❌
20.20.2 ✅ 26 tools ✅ (works, though puppeteer 25 doesn't officially support Node 20)
22.23.3 ✅ ✅

Other packages above the declared minimum

  • @supabase/supabase-js@2.90.0 and its @supabase/* packages, plus iceberg-js@0.8.1, declare engines: node >=20.0.0. npm ci on Node 18 prints EBADENGINE for them. On Node 20, supabase-js logs that "Node.js 20 and below are deprecated".
  • In the repo's own test suite on Node 18/20, these fail on unmodified main (GitHub Actions, Ubuntu + macOS):
    • test-markdown-editor-roundtrip and test-markdown-editor-edit-diff fail with ReferenceError: navigator is not defined. prosemirror-view expects the global navigator, which Node only provides from v21.
    • test-remote-channel-reconnect fails on Node 18.
  • PDF reading logs TypeError: o.transferToFixedLength is not a function on Node 18/20, because pdf.js uses ArrayBuffer.prototype.transferToFixedLength, which needs Node 21+. Some page content may be lost.
  • sharp@0.35.x, the version that fixes the libvips advisories, requires Node >=20.9.0.
  • On Ubuntu with Node 22, all 67 test files pass. That's the version release.yml uses.

Options (maintainers' call)

  1. Raise the declared minimum, in both engines and the manifest runtimes, to what actually works. That's at least >=20.19 (needed for require() of ESM), or >=22.12 to match puppeteer 25's declared support. This also unblocks the sharp bump.
  2. Keep Node 18 support by pinning puppeteer to ^24 (for example as a direct dependency or through overrides). Note that puppeteer 24 also lacks the fix for the @puppeteer/browsers/extract-zip advisories, and the supabase packages already require Node 20.
  3. Separately, lazy-loading the PDF stack (as fix(startup): load the Excel, PDF and DOCX packages on first use (#715) #777 proposes) should turn the Node 18 startup crash into a PDF-only failure. It's worth doing whichever option is chosen.

Found while testing #516. That PR doesn't touch this: the same behaviour occurs on unmodified main.

Activity

  1. serg33v commented on Oct 10, 2026

    @serg33v
    Collaborator

    we recommend to use nodejs 22, we will update our versions requirements in next releases.
    re PDF loading fix is already in progress.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions