Skip to content

[BUG] - r2modman 3.2.13 fails to build on Arch (electron-builder JSON parse error) #2057

Description

@BlueShadowVirus

Describe the bug
r2modman 3.2.13 fails to build on Arch Linux when installed via yay (AUR) or when built manually with makepkg. The failure occurs during the electron-builder packaging step.

The root cause is that r2modman 3.2.13 upgraded to electron-builder 26.x, which now requires a zipped Electron distribution. Arch Linux ships Electron as an unpacked directory in /usr/lib/electron38, without the metadata files electron-builder expects.

This causes electron-builder to attempt to read a non‑existent metadata file and crash with:

SyntaxError: Unexpected end of JSON input

r2modman 3.2.11 builds successfully, because it uses electron-builder 24.x, which still supports system Electron.


To Reproduce
Steps to reproduce the behavior:

  1. On Arch Linux, run:

    yay -Syu r2modman
    

    or:

    git clone https://aur.archlinux.org/r2modman.git
    cd r2modman
    makepkg -si
    
  2. Build proceeds normally until the electron-builder step

  3. electron-builder logs:

    custom electronDist provided but no zip found; assuming unpacked electron directory.
    electronDist=/usr/lib/electron38 expectedFile=electron-v38.7.2-linux-x64.zip
    
  4. Build fails with:

    SyntaxError: Unexpected end of JSON input
    

Expected behavior
The package should build successfully on Arch Linux, as r2modman 3.2.11 does.


Screenshots
Relevant excerpt from the yay build log:

• electron-builder  version=26.0.12 os=6.18.6-arch1-1
• packaging       platform=linux arch=x64 electron=38.7.2
• custom electronDist provided but no zip found; assuming unpacked electron directory.
  electronDist=/usr/lib/electron38 expectedFile=electron-v38.7.2-linux-x64.zip

SyntaxError: Unexpected end of JSON input

App • ⚠   FAIL  App build failed
==> ERROR: A failure occurred in build().

Additional context

  • Arch Linux ships Electron as an unpacked directory, not a zip file

  • electron-builder 26.x requires zipped Electron distributions

  • The AUR PKGBUILD injects:

    electronDist="/usr/lib/electron38"
    electronVersion="$(<$_electronDist/version)"
    

    This worked with electron-builder 24.x but is incompatible with 26.x.

  • This affects all Arch users installing via yay or building from source

  • Downgrading electron-builder to 24.x or allowing electron-builder to download its own Electron zip resolves the issue


Environment

  • OS: Arch Linux (rolling release)
  • Install method: yay (AUR)
    The failure also occurs when building manually with makepkg.
  • Package version: r2modman 3.2.13-1 (AUR)
  • Working previous version: r2modman 3.2.11-1
  • Kernel: 6.18.6-arch1-1
  • Electron (system): electron38 (38.7.2) installed from Arch repositories
    → Arch ships Electron as an unpacked directory in /usr/lib/electron38
  • Node: 20.x (from Arch repos)
  • Yarn: 4.11.0 (via corepack)
  • electron-builder version used by r2modman 3.2.13: 26.0.12
  • Build environment:
    • yay build directory: ~/.cache/yay/r2modman
    • PKGBUILD unmodified
    • Build fails during the electron-builder packaging step

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugMinor issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions