Skip to content

Comments

fix: pnpm "Invalid string length" errors during node module collection#9470

Merged
mmaietta merged 1 commit intoelectron-userland:masterfrom
danteissaias:dante/12-27_fix-pnpm-invalid-string-length-errors-during-node-module-collection
Dec 28, 2025
Merged

fix: pnpm "Invalid string length" errors during node module collection#9470
mmaietta merged 1 commit intoelectron-userland:masterfrom
danteissaias:dante/12-27_fix-pnpm-invalid-string-length-errors-during-node-module-collection

Conversation

@danteissaias
Copy link
Contributor

Closes #9469

electron-builder calls pnpm list --prod --json --depth Infinity --long to collect node modules with pnpm. My project has many dependencies, so this command fails with the following error:

{
  "error": {
    "code": "pnpm",
    "message": "Invalid string length"
  }
}

Removing --long resolves this error. This flag adds the following fields to the output:

  • description
  • license
  • author
  • homepage
  • repository

electron-builder doesn't appear to consume any of these fields, so --long can safely be removed.

@changeset-bot
Copy link

changeset-bot bot commented Dec 27, 2025

🦋 Changeset detected

Latest commit: 30153c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@danteissaias danteissaias force-pushed the dante/12-27_fix-pnpm-invalid-string-length-errors-during-node-module-collection branch from 839d598 to 8554741 Compare December 27, 2025 21:24
@danteissaias danteissaias force-pushed the dante/12-27_fix-pnpm-invalid-string-length-errors-during-node-module-collection branch from 8554741 to 30153c6 Compare December 27, 2025 21:26
@danteissaias danteissaias marked this pull request as ready for review December 27, 2025 21:27
@beyondkmp
Copy link
Contributor

very good catch.

LGTM

@danteissaias
Copy link
Contributor Author

Thanks, although I'm not sure what is causing the test failure. It seems unrelated to the change I made.

@mmaietta
Copy link
Collaborator

It's a flaky test; re-running the tests. Not sure why it's minorly flaky, but also not sure if it's worthwhile to solve for that with the complexity of install+run+serve/autoupdate+relaunch within a docker container.

@mmaietta mmaietta merged commit d38ae8e into electron-userland:master Dec 28, 2025
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PNPM node modules collectors fails with lots of dependencies

3 participants