Skip to content

Some files in app.asar get corrupted #662

@pmoleri

Description

@pmoleri

electron-builder v5.24.0 (it doesn't happen in 5.16.0)
Target: windows

The built app fails during startup page loading due a corrupted dependency in the app.asar file.

Steps:

  • create a new project with this package.json
{
  "name": "test",
  "version": "1.0.0",
  "description": "test",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "build": {
    "appId": "your.id",
    "category": "your.app.category.type",
    "icon": "icon.ico",
    "iconUrl": "https://github.com/favicon.ico"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "debug": "^2.2.0",
    "edge-cs": "^1.0.0"
  },
  "devDependencies": {
    "electron": ""^1.3.3",
    "electron-builder": "^5.24.0"
  }
}
  • Add required files:
    • icon.ico (at least 256x256)
    • index.js (can be empty)
  • Exec:
npm install
node_modules/electron-builder/out/build-cli.js
cd dist/win-unpacked/resources
asar extract app.asar app.asar.extracted
  • Open app.asar.extracted/node_modules/debug/package.json
    This file and others in the same package are corrupted.

I think the problem may have something to do with having modules with "executable code":

node_modules\edge-cs is not packed into asar archive - contains executable code
node_modules\electron is not packed into asar archive - contains executable code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions