electron icon indicating copy to clipboard operation
electron copied to clipboard

Cannot Pack a Fresh App

Open Hodes opened this issue 1 year ago • 1 comments

Describe the bug I created a new app and added the platform template from this project. Then I attempted to build the project, but it resulted in an error by using the provided 'electron:pack' npm command.

To Reproduce

cd /tmp
ionic start # go through the installer, react, blank
npm i @capacitor-community/electron
ionic build
npx cap add @capacitor-community/electron
#npx cap open @capacitor-community/electron # works correctly
cd electron
npm run electron:pack #fails

Expected behavior It should probably not fail and generate the artifacts

Errors

node_modules/builder-util-runtime/out/httpExecutor.d.ts:9:5 - error TS2411: Property '"accept-charset"' of type 'string | string[]' is not assignable to 'string' index type 'string'.

9     [key: string]: string;
      ~~~~~~~~~~~~~~~~~~~~~~

node_modules/builder-util-runtime/out/httpExecutor.d.ts:9:5 - error TS2411: Property '"accept-encoding"' of type 'string | string[]' is not assignable to 'string' index type 'string'.

9     [key: string]: string;
      ~~~~~~~~~~~~~~~~~~~~~~

node_modules/builder-util-runtime/out/httpExecutor.d.ts:9:5 - error TS2411: Property '"accept-language"' of type 'string | string[]' is not assignable to 'string' index type 'string'.

9     [key: string]: string;
      ~~~~~~~~~~~~~~~~~~~~~~
.....

The list goes on...

Found 17 errors in 2 files.

Errors  Files
    16  node_modules/builder-util-runtime/out/httpExecutor.d.ts:9
     1  node_modules/chokidar/types/index.d.ts:9

Desktop:

  • OS: Fedora 40
  • Node: v20.12.2
  • In main project folder relevant package.json dependencies
    • "@capacitor-community/electron": "^5.0.1"
    • "@capacitor/core": "6.0.0",
  • In electron generated folder relevant package.json dependencies
"dependencies": {
  "@capacitor-community/electron": "^5.0.0",
  "chokidar": "~3.5.3",
  "electron-is-dev": "~2.0.0",
  "electron-serve": "~1.1.0",
  "electron-unhandled": "~4.0.1",
  "electron-updater": "^5.3.0",
  "electron-window-state": "^5.0.3"
},
"devDependencies": {
  "electron": "^26.2.2",
  "electron-builder": "~23.6.0",
  "electron-rebuild": "^3.2.9",
  "typescript": "^5.0.4"
}

Additional context I think the problem is 100% reproducible, maybe the current dependencies are outdated in the electron app template.

Thankyou !

Hodes avatar Jun 04 '24 22:06 Hodes

Same issue...

EDIT: Found the solution!

  1. Upgrade "electron-builder": npm install [email protected] --save-dev
  2. Upgrade "electron-updater": npm install [email protected]
  3. Upgrade "chokidar": npm install [email protected]

klocus avatar Aug 10 '24 10:08 klocus