Closed dariov1988 closed 11 months ago
Trace points like the exception is thrown inside Electron Forge's code and it is not caused by anything in ReForged.
Could you share the resulted package.json
and any additional configuration files related to Electron Forge like forge.config.js
if you made any after repo init?
Also maybe try using the Electron Forge templates and just add AppImage maker to it?
No additional steps have been made, I just forget to enter on the created directory after call init electron-app, so I edit the original post. The package.json and the forge.config.js are the generated by default:
package.json
{
"name": "myapp",
"productName": "myapp",
"version": "1.0.0",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "My Name",
"email": "myemail@something.something"
},
"license": "MIT",
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"devDependencies": {
"@electron-forge/cli": "^7.1.0",
"@electron-forge/maker-deb": "^7.1.0",
"@electron-forge/maker-rpm": "^7.1.0",
"@electron-forge/maker-squirrel": "^7.1.0",
"@electron-forge/maker-zip": "^7.1.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.1.0",
"@reforged/maker-appimage": "^3.3.1",
"electron": "27.1.2"
}
}
forge.config.js
module.exports = {
packagerConfig: {
asar: true,
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
I read https://www.npmjs.com/package/@reforged/maker-appimage and their it sais that "The maker itself should work out-of-the-box" so I try to run it out of the box, also I add the recommended configuration provided on that page but this did not produce any change. What Electron Forge templates are we talking about exactly?, I also try with:
npm init electron-app@latest my-app -- --template=webpack
from here: https://www.electronforge.io/#using-templates, and I got the same result.
Thanks for the quick response. Let me know if something else is needed.
Have you succeed setting up Electron Forge by itself? Because with this configuration, AppImage maker shouldn't even be loaded (since it isn't listed in the config and I'm pretty sure Forge is unable to find the makers by itself or anything)…
Also I've tested the example Electron app I host within this repo (which is the minimal config that sets changes nothing in ReForged and loads no other makers than from it) to check if AppImage maker will work properly and looks like nothing is broken with Forge 6.x.y, but it doesn't work with 7.x.y. I supsect the crash could be due to ReForged using the older version of @electron-forge/maker-base
that is incompatible with current version of Forge.
I think before I'll update my version of Forge here I'll set all forge-associated deps as peerDependencies
to not let that uncaught exception to happen again – since looks like Forge doesn't care about the backwards compatibility with the older makers.
Hi @SpacingBat3, for the first question, yes, out of the box Electron Forge builds the rpm and deb packages ok for me. As I explained further in the previous comment, I also added the recommended configuration provided on https://www.npmjs.com/package/@reforged/maker-appimage, and updated the parameters according, but this didn't produce any different result. It seems that you were able to reproduce the problem with the current version of Forge (7.x.y). I will not downgrade for now, since I do not need to start distributing my app right away. Thanks a lot for your time and effort put into this library. Please let me know if I can help with testing or providing extra information.
Actually by looking at Forge, there's basically no way to enforce it to conflict with makers with older implementation of MakerBase
class – that means I suppose for now that it is expected for users to check for API compatibility themselves, at least for now. I guess the one could create an issue ticket to have this resolved in the future and to have Forge to enforce some kind of guidelines in terms of third-party makers implementation around NPM dependencies.
That means, no peerDependencies
hack and no fixing this issue; I'll do of course an update later, maybe even set such version that installing older Forge will be possible with this maker, but for now if you want to use it, I guess you'll have to stick to Electron Forge 6.x.y.
I think I might even take a look at Forge's internals and try to fix this at upstream myself.
Also narrowing the issue to the upstream commit: https://github.com/electron/forge/commit/7370d6e9e3e08be22e169c6712144ff24b08ecee.
Using node v20.10.0 or v18.18.2 I create a fresh Electron project with the following steps:
npm init electron-app@latest myapp cd myapp yarn add --dev @reforged/maker-appimage npm run make -- --targets "@reforged/maker-appimage"
and I got:
Please let me know if extra information is needed or if I'm missing additional steps. Thanks!