Skip to content

--app-version 1.0 gives error message "Invalid processed options" #1853

@mhjacobson

Description

@mhjacobson

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

$ npx electron-packager --version
Electron Packager 19.0.1
Node v22.19.0
Host Operating system: darwin 21.6.0 (x64)
  • Last Known Working Electron Packager version::
    18.4.4

To Reproduce

$ npx @electron/packager ... \
  --app-version "1.0" ...

Expected Behavior

Packges the app with version "1.0".

Actual Behavior

Errors out with:

Invalid processed options

Additional Information

This is because, in src/packager.ts in isValidProcessedOptions(), you check whether typeof opts.appVersion === 'string'. But 1.0 can be represented as a number. (The docs do not seem to require the --app-version to be a non-number.)

This appears to have been introduced by df586b9.

Finally, even if --app-version should be required to be a non-number, "Invalid processed options" does not convey that well at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions