fix: keep app-version and related CLI args as strings#1923
Open
claude[bot] wants to merge 1 commit into
Open
Conversation
yargs-parser was coercing numeric-looking values for app-version, build-version and app-copyright into JS numbers (e.g. --app-version 1.0 became the number 1). This failed the `typeof opts.appVersion === 'string'` check in src/packager.ts and threw the generic "Invalid processed options" error. Add these flags to the yargs `string:` allow-list so they are never coerced, plus a regression test asserting they stay strings. Fixes #1853.
|
Thanks for opening a pull request! Here are some highlighted action items that will help get it across the finish line, from the
Development and triage is community-driven, so please be patient and we will get back to you as soon as we can. |
MarshallOfSound
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Samuel Attard · Slack thread
Before / After
Running
electron-packager … --app-version "1.0"(or any numeric-looking version) failed with the generic errorInvalid processed optionsin 19.x. With this change it packages correctly with version"1.0".What was happening
The CLI parses args with
yargs-parser. Thestring:allow-list inparseArgs(src/cli.ts) only includedelectron-versionandout, so--app-version 1.0was auto-coerced to the JS number1(also truncating1.0→1). That fails thetypeof opts.appVersion === 'string'check insrc/packager.tsand throws. The same applied to--build-versionand--app-copyright.Fix
Add
app-version,build-version, andapp-copyrightto the yargsstring:array so they're never coerced. Adds a regression test intest/cli.spec.tsasserting these stay strings (e.g.appVersion === "1.0").tscbuilds clean; full vitest suite passes (19/19).Fixes #1853.
Generated by Claude Code