SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.73k stars 740 forks source link

Build the app with electron-builder #1693

Closed Mykab54 closed 5 months ago

Mykab54 commented 10 months ago

I try to build the app with electron-builder. For this, I have added in package.json the following:

"build": {
    "appId": "AppID",
    "productName": "seleniumIDE",
    "directories": {
      "output": "dist"
    },
    "linux": {
      "target": [
        {
          "target": "deb"
        }
      ],
   }
}

And in scripts:

"scripts": {
    "dist": "electron-builder"
}

After that I do

$ pnpm run dist

It works but when I want to start the app with

$ seleniumIDE

I got this error: " Unable to startup due to chromedriver error: Missing executable at path /opt/seleniumIDE/resources/app.asar.unpacked/packages/-selenium-ide/node_modules/electron-chromedriver/bin/chromedriver "

toddtarsi commented 10 months ago

@Mykab54 - You adding this to the top level package.json or the package.json in the selenium-ide package?

Mykab54 commented 10 months ago

@toddtarsi I add this in the root of the project folder

toddtarsi commented 10 months ago

Check out packages/selenium-ide/package.json. The build:electron command in there is used by the CI to build for mac / windows / etc

toddtarsi commented 10 months ago

@Mykab54 - Just wanted to check in and see if you were able to build successfully

Mykab54 commented 10 months ago

@toddtarsi I recloned selenium-ide and tried to build with electron-builder from packages/selenium-ide. I got the following:


> @seleniumhq/selenium-ide@4.0.0-alpha.47 build:electron /home/gsw/Desktop/ide/selenium-ide/packages/selenium-ide
> CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder -mwl -c.electronVersion $(node -e "console.log(require('electron/package.json').version)") --publish never

  • electron-builder  version=24.4.0 os=5.15.0-79-generic
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  ⨯ /home/gsw/Desktop/ide/selenium-ide/node_modules/.pnpm/iconv-corefoundation@1.1.7/node_modules/iconv-corefoundation/lib/native.node: invalid ELF header  failedTask=build stackTrace=Error: /home/gsw/Desktop/ide/selenium-ide/node_modules/.pnpm/iconv-corefoundation@1.1.7/node_modules/iconv-corefoundation/lib/native.node: invalid ELF header
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1280:18)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/home/gsw/Desktop/ide/selenium-ide/node_modules/.pnpm/iconv-corefoundation@1.1.7/node_modules/iconv-corefoundation/lib/native.js:5:18)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/home/gsw/Desktop/ide/selenium-ide/node_modules/.pnpm/iconv-corefoundation@1.1.7/node_modules/iconv-corefoundation/lib/index.js:6:18)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "build:electron" exited with 1.
 ELIFECYCLE  Command failed with exit code 1.
toddtarsi commented 10 months ago

@Mykab54 - To give some context, that -mwl flag means -mac -windows -linux. I think you just want linux here, try replacing -mwl with just -l. That said, elf header sounds kinda linux-y, but that might make this less painful to debug

toddtarsi commented 5 months ago

@Mykab54 - I am going to close this issue. Our CI builds for all three platforms pretty consistently, so if there is a knowledge gap I can close, I'd be happy to. But all and all, there's not much else for me to do here.

github-actions[bot] commented 4 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.