You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression in pnpm 10.29.3 with Electron packaging (transitive dependency missing at runtime) #10601
Use pnpm 10.29.2 on macOS with an Electron + electron-builder project.
Run: pnpm install --frozen-lockfile
Run: pnpm run build && pnpm exec electron-builder --mac mas-dev
Inspect app.asar: node_modules/ms is present.
Then upgrade only pnpm to 10.29.3 and run the same commands.
Result: app launches with runtime error Cannot find module 'ms' (require stack includes debug/src/common.js), and app.asar contains node_modules/debug but not node_modules/ms.
Expected behavior
Patch upgrade from pnpm 10.29.2 to 10.29.3 should not change packaged runtime dependency completeness. Required transitive dependencies (such as ms) should remain present in app.asar.
Actual behavior
With pnpm 10.29.3, packaged Electron app crashes at runtime with Cannot find module 'ms' from debug/src/common.js. In app.asar, node_modules/debug exists but node_modules/ms is missing. Downgrading to pnpm 10.29.2 restores normal behavior.
Additional information
Environment (anonymized):
macOS (Apple Silicon)
Homebrew-installed pnpm
Node.js v25.6.1
Electron + electron-builder (MAS target)
This appears to be a regression between pnpm 10.29.2 and 10.29.3 for this packaging workflow.
Node.js version
v25.6.1
Operating System
macOS
Reacted by Sivcan Singh, Diogo Correia, Gergő Gutyina and Sefa Eyeoglu
From what I understand, pnpm ls --json previously emitted the complete subtree for every occurrence of a package (with circular detection as the only deduplication); it now emits a truncated node for subsequent occurrences. In JSON output, a deduplicated node is elided.
Electron-builder's dependency collector was written assuming that pnpm ls --json --depth Infinity always fully expands every node in the tree. Its recursive walker visits the dependencies map of each node to collect all packages' real paths.
What is needed from the electron-builder side to resolve this? 🙂 Looks like it was an OOM fix, so maybe there are some changes I can make on my side to balance this out? Let me know.
Thanks @mmaietta for looking into it. It would be best to change electron-builder. We can't really go back to the old format as the list command was broken, slow, and failed with OOM on bigger projects. If electron-builder needs some additional data to reconstruct the full graph or if we can improve the json format otherwise, I am open to such improvements. But we can't just go back to duplication.
This does not reproduce on current pnpm, so closing.
Verified on pnpm 12.5.1: a dependency's own transitive dependency is present next to it, both in the isolated layout and with nodeLinker: hoisted, and resolves from it.
If you still hit this on the latest pnpm, please comment with a reproduction and we will reopen.
Activity
zkochan commentedon Feb 13, 2026
I don't see any changes in v10.29.3 that could cause such an issue: https://github.com/pnpm/pnpm/releases/tag/v10.29.3
do you have a repo that reproduces the issue? I don't know how to create an electron project.
dex4er commentedon Feb 13, 2026
@zkochan You can check this PR: freelensapp/freelens#1637
With pnpm 10.29.2 all is fine. After the upgrade the application breaks with mysterious errors like
Error: Cannot find module '@so-ric/colorspace': https://github.com/freelensapp/freelens/actions/runs/21960356282/job/63435818307?pr=1637#step:34:38Steps to reproduce it after git clone of this repo:
Result: crashes in the main process (Chrome browser)
Anonymous327 commentedon Feb 13, 2026
Having the same issue here. It's weird. Builds just fine with any version below 10.29.3, but "missing modules" with the latest version.
MoeFurina commentedon Feb 14, 2026
The same issue occurred in the project build of imsyy/splayer
dex4er commentedon Feb 19, 2026
FYI: 10.30.0 breaks too
https://github.com/freelensapp/freelens/actions/runs/22110729719/job/63905936696?pr=1637#step:34:468
mmaietta commentedon Feb 20, 2026
Could this be related?
https://github.com/pnpm/pnpm/pull/10586/changes#diff-f2c67b6ce1dd4f075157bf06c2eb506a6b2fb31d1eff02097f2abf41d9e711d0
Electron-builder runs
pnpm ls --json --depth Infinity --prodto walk the full dependency tree before pulling packages to copy into the app bundle. It parses the JSON output recursively to collect every package's real filesystem path, then copies those directories into the final build artifact.https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/node-module-collector/pnpmNodeModulesCollector.ts
From what I understand,
pnpm ls --jsonpreviously emitted the complete subtree for every occurrence of a package (with circular detection as the only deduplication); it now emits a truncated node for subsequent occurrences. In JSON output, a deduplicated node is elided.{ "alias": "ajv", "version": "8.17.1", "path": "/path/to/.pnpm/[email protected]/...", "deduped": true, "dedupedDependenciesCount": 5 }Electron-builder's dependency collector was written assuming that
pnpm ls --json --depth Infinityalways fully expands every node in the tree. Its recursive walker visits the dependencies map of each node to collect all packages' real paths.What is needed from the
electron-builderside to resolve this? 🙂 Looks like it was an OOM fix, so maybe there are some changes I can make on my side to balance this out? Let me know.zkochan commentedon Feb 20, 2026
Thanks @mmaietta for looking into it. It would be best to change electron-builder. We can't really go back to the old format as the list command was broken, slow, and failed with OOM on bigger projects. If electron-builder needs some additional data to reconstruct the full graph or if we can improve the json format otherwise, I am open to such improvements. But we can't just go back to duplication.
mmaietta commentedon Feb 20, 2026
Yep, fully aligned there. Let me see what I can come back with and will reach out if I need additional data/insight.
yanglee2421 commentedon Feb 27, 2026
Same issue here, Go back to pnpm@9 to resume work
Molunerfinn commentedon Mar 6, 2026
Same issue here. 10.29.2 works
pnpm_10_29_2: init
Anonymous327 commentedon Mar 11, 2026
Has this been fixed yet?
mmaietta commentedon Mar 11, 2026
It's fixed in
nextelectron-builder release 26.8.2.I think this issue can be closed since pnpm is not reverting the breaking API-response change and a fix has been patched released in electron-builder.
faithmckinely-alt commentedon Mar 12, 2026
thedogecraft commentedon Apr 1, 2026
Thanks.
feat: switch back to pnpm
feat(app): macOS 签名 + 公证全链路——entitlements / packaging 修复 / productNam…
Upgrade electron-builder to 26.11.1 to fix missing transitive deps in…
Fix electron-builder packaging under pnpm: pin 10.29.2, patch collector
🐛 Fix the packaged app missing transitive dependencies
XS⚠️ ◾ 🔧 Migrate the desktop app from npm to pnpm (#1040)
build(ci): pin pnpm to 10.29.2 while electron-builder cannot see the …
build(ci): pin pnpm to 10.29.2 while electron-builder cannot see the …
build(packaging): keep build tooling and renderer-only packages out o…
test: pin pnpm at 10.28.2 pending collector support for pnpm >= 10.29…
zkochan commentedon Sep 19, 2026
This does not reproduce on current pnpm, so closing.
Verified on pnpm 12.5.1: a dependency's own transitive dependency is present next to it, both in the isolated layout and with
nodeLinker: hoisted, and resolves from it.If you still hit this on the latest pnpm, please comment with a reproduction and we will reopen.
Written by an agent (Claude Code, claude-opus-5).