You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
7.5.0
Electron version
v33.0.2
Operating system
Ubuntu 20.04.6 LTS
Last known working Electron Forge version
No response
Expected behavior
build should work
Actual behavior
not working
Steps to reproduce
set name shutdown-scheduler in package.json
set product name Shutdown Scheduler in package.json
run make command on ubuntu
error happens
An unhandled rejection has occurred inside Forge:
Error: could not find the Electron app binary at "/home/user/Desktop/my-timer-app/out/Shutdown Scheduler-linux-x64/shutdown-scheduler". You may need to re-bundle the app using Electron Packager's "executableName" option.
at /home/user/Desktop/my-timer-app/node_modules/electron-installer-common/src/installer.js:154:15
at async Promise.all (index 3)
at async module.exports (/home/user/Desktop/my-timer-app/node_modules/electron-installer-debian/src/installer.js:261:3)
at async MakerDeb.make (/home/user/Desktop/my-timer-app/node_modules/@electron-forge/maker-deb/src/MakerDeb.ts:41:30)
at async /home/user/Desktop/my-timer-app/node_modules/@electron-forge/core/src/api/make.ts:280:41
at async _Task.taskFn (/home/user/Desktop/my-timer-app/node_modules/@electron-forge/tracer/src/index.ts:51:14)
at async _Task.run (/home/user/Desktop/my-timer-app/node_modules/listr2/dist/index.cjs:2063:11)
error Command failed with exit code 1.
from my obersvations, on macOS the generated binary is called Shutdown Scheduler and make works fine, but on ubuntu, the binary is called Shutdown Scheduler but make seems to be looking for shutdown-scheduler instead.
it seems the issue is fixed when i set executableName: "shutdown-scheduler" in forge packagerConfig but i don't understand why this error only happens on ubuntu.
importtype{ForgeConfig}from"@electron-forge/shared-types";import{MakerSquirrel}from"@electron-forge/maker-squirrel";import{MakerZIP}from"@electron-forge/maker-zip";import{MakerDeb}from"@electron-forge/maker-deb";// import { MakerRpm } from "@electron-forge/maker-rpm";import{VitePlugin}from"@electron-forge/plugin-vite";import{FusesPlugin}from"@electron-forge/plugin-fuses";import{FuseV1Options,FuseVersion}from"@electron/fuses";constconfig: ForgeConfig={packagerConfig: {asar: false,},rebuildConfig: {},makers: [newMakerSquirrel({}),newMakerZIP({},["darwin"]),// new MakerRpm({}),newMakerDeb({}),],plugins: [newVitePlugin({// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.// If you are familiar with Vite configuration, it will look really familiar.build: [{// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.entry: "src/main.ts",config: "vite.main.config.ts",target: "main",},{entry: "src/preload.ts",config: "vite.preload.config.ts",target: "preload",},],renderer: [{name: "main_window",config: "vite.renderer.config.ts",},],}),// Fuses are used to enable/disable various Electron functionality// at package time, before code signing the applicationnewFusesPlugin({version: FuseVersion.V1,[FuseV1Options.RunAsNode]: false,[FuseV1Options.EnableCookieEncryption]: true,[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,[FuseV1Options.EnableNodeCliInspectArguments]: false,[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,[FuseV1Options.OnlyLoadAppFromAsar]: false,}),],};exportdefaultconfig;
The text was updated successfully, but these errors were encountered:
hichemfantar
changed the title
Vite React TS - Ubuntu .deb build: name and productName are not used correctly during packaging
Vite React TS - Ubuntu .deb: make command fails "Error: could not find the Electron app binary"
Nov 9, 2024
Similar boat, also from the Vite TS template with React added to it.
From what I can tell, there's something wrong with how the name value from package.json is used in the build process with the Vite TS template and MakerDeb. The raw executable is built successfully, but the process errors when trying to create the installer due to the name mismatch described by the error in this issue.
Here's what works:
Using name in package.json on its own, but do NOT use NPM-style naming (e.g. no @groupname/projectname as the build step will treat that as a directory path to a file, not a file only).
Same as above plus an executableName in the forge.config.ts file's packagerConfig object. The name in package.json and executableName in packagerConfig must have identical values.
If you do this, you can then also use productName to give the app a nice professional user-facing name too.
While you can still set values into the config of MakerDeb, bin is ignored. Documentation is sparse but I assumed that bin was the platform-specific version of executableName, so it's weird to me that it's not used. Using productName in the MakerDeb config or the package.json file allows that property to work, though the installer and executable name will not match it. Shows up in the software menu, at least.
Maybe this is all working as intended - I can clearly build with the right specific mix of values in place - but if so, then documentation needs improvement. Especially for MakerDebConfig, which has no way to view its options other than digging into source code. Kinda defeats the point of having a documentation website at that stage.
Normal, intuitive work led to the same errors that this issue is about. Workarounds exist, at least.
Pre-flight checklist
Electron Forge version
7.5.0
Electron version
v33.0.2
Operating system
Ubuntu 20.04.6 LTS
Last known working Electron Forge version
No response
Expected behavior
build should work
Actual behavior
not working
Steps to reproduce
shutdown-scheduler
in package.jsonShutdown Scheduler
in package.jsonfrom my obersvations, on macOS the generated binary is called
Shutdown Scheduler
and make works fine, but on ubuntu, the binary is calledShutdown Scheduler
but make seems to be looking forshutdown-scheduler
instead.it seems the issue is fixed when i set
executableName: "shutdown-scheduler"
in forgepackagerConfig
but i don't understand why this error only happens on ubuntu.Additional information
package.json
forge.config.ts
The text was updated successfully, but these errors were encountered: