electron-forge | complete tool for creating publishing | Runtime Evironment library
kandi X-RAY | electron-forge Summary
kandi X-RAY | electron-forge Summary
A complete tool for building modern Electron applications. Electron Forge unifies the existing (and well maintained) build tools for Electron development into a simple, easy to use package so that anyone can jump right in to Electron development.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of electron-forge
electron-forge Key Features
electron-forge Examples and Code Snippets
Community Discussions
Trending Discussions on electron-forge
QUESTION
I developed a small application with electron and expressjs. In development mode, the app works fine. But after packaging the app for the production mode I got the error that the home view is not found. Here are some details: The main route in app.js
...ANSWER
Answered 2022-Apr-02 at 11:06You need an express.static(...)
statement somewhere in your app to serve the css and js files. How does that look? The following should work:
QUESTION
I would like to be able to open a deep link and take that protocol url and login with it. I have successfully got the electron app to open from the deep link but I can't seem to get the url or parameter from the deep link. I followed the tutorial from https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app but I wasn't able to get it to work on ubuntu. In the tutorial it when you open from deep link it opens a dialog box but the open-url listener isn't getting called. Is there something I am missing to getting the open-url to work on linux.
Heres my index.ts
...ANSWER
Answered 2022-Mar-29 at 06:38Figured out what was wrong. The documentation has the linux and mac as the same but linux is different or at least on debian it is. The documentation says to put into the app.on('open-url', (event, url)
event but this doesn't work for linux or at least it didn't work for me.
Apparently or what I found that you have to grab it from the arguments from when it is called by the operating system to open. So what I did was in the app when ready event is finished i did:
QUESTION
When import 'semantic-ui-css/semantic.min.css'
into a brand new Electron-Forge/Webpack5 project, I get the following:
ANSWER
Answered 2021-Jul-26 at 17:05Finally fixed it...
Electron-Forge installs a recent version of CSS-Loader, whereas the website still has quite an old version. Downgrading fixed the issue.
QUESTION
How do I solve this error? where/how do I set those settings? I'm new to electron/react
Refused to connect to 'ws://localhost:3000/cpp' because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-inline' data:". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
I'm using electron + react and electron-forge build system. I've tried using this in froge.config.js
:
ANSWER
Answered 2022-Mar-26 at 20:38WebpackPluginRendererConfig
QUESTION
I trying to build an electron with an exe installer on macOS with a MacBook Pro with an m1. I already tried different packages like electron-packager, electron-forge, but unfortunately, none of my tries worked. Did anyone has a solution to build an electron version with an exe on macOS. My latest approach looked like, but when I start and after more then 30 minute it still do no finish.
yarn run electron-forge make --arch=x64 --platform=win32
The current code could be found here.
...ANSWER
Answered 2022-Mar-09 at 09:15We using electron-builder for packaging electron app on Windows&MacOS(x86_x64/arm etc.), and you can try it.
add some config in package.json, like this:
QUESTION
I'm developing a chat application with Electron and would like to run two instances of the same Electron application to run concurrently for debugging purposes.
I used Electron Forge to instantiate the project, which uses port 3000 by default, and attempting to run the same application in another process leads to an address already in use error.
Did some research into this and saw approaches to run the client & application code on different ports, along with how to change the default port on Electron Forge.
I've thought about having the Electron app run on a randomly generated port number to avoid taking up the same port number, but curious whether there's a simpler way to do this.
Error message attached below:
...ANSWER
Answered 2022-Feb-02 at 21:02Here's a basic workaround. This is assuming use of the Webpack bundler with Electron Forge. Electron Forge instantiates a devserver by default on port 3000, so we'll want to modify the port number to be able to run more than one app concurrently.
- Start the first instance of the Electron app with npm start
- In package.json, add a port and loggerPort property within @electron-forge/plugin-webpack to set a custom port and or loggerport. Example shown below. This post goes into more detail on why this works.
QUESTION
I am trying to open a sqlite3 database encrypted with sqlcipher. I have the password and I could open it successfully using sqlitebrowser.
I started my project using this template. It is based on the electron-forge webpack plugin.
When I type yarn start
, it creates a .webpack folder and all the compiled code goes in it. When I stop the terminal command, this folder disappears.
Then I wanted to use the package @journeyapps/sqlcipher to open my database, but this line is causing an error in the main process: const sqlite3 = require("@journeyapps/sqlcipher")
The error is:
Error: Cannot find module '<>/.webpack/main/native_modules/lib/binding/napi-v6-linux-x64/node_sqlite3.node'
The package documentation says two things about using it with electron-forge:
make sure that the folder node_modules/@journeyapps/sqlcipher/lib/binding/napi-v6-linux-x64 exists -> yes it exists
Disable rebuilding of this library using the onlyModules option of electron-rebuild in your package.json
"config": { "forge": { "electronRebuildConfig": { "onlyModules": [] // Specify other native modules here if required } }
-> I did it, I added the lines of code
I still have the error, but I feel it can be solved "easily" (with a lot more understanding of webpack than I have). Indeed, a solution would be to move the folder binding/napi-v6-linux-x64 into .webpack each time I launch the app, right?
I tried to do electron-rebuild -f -w sqlite3
, the rebuild succeeded but nothing happens, I still have the same error.
I am stuck here and cannot go further for my app, as it lays on reading this database. Should I start a new project and avoid using webpack? Do you have any example of a project where this package is successfully imported and used?
Thank you in advance for your help!
...ANSWER
Answered 2022-Jan-21 at 15:17Well, I finally figured it out. Actually, I tried so much little changes but I managed to make the app work (nearly) as expected.
How I found the solutionFirst: this doesn't have anything to do with the library sqlcipher itself. In fact, it's a webpack configuration problem while dealing with native libraries.
I started a fresh minimal install of electron-forge with Webpack and Typescript template (npx create-electron-app test-electron-forge-github --template=typescript-webpack
) and added sqlite3 and @journeyapps/sqlcipher. It worked so I made a lot of changes in my Webpack configuration to make it closer with the electron-forge one.
The changes I made broke Redux. I chose to sacrifice Redux in order to make sqlcipher work, as today I didn't find a solution for both of them to work.
Old Webpack configuration filesmain.webpack.js
QUESTION
I have spent multiple days reading through tickets and documentation trying to find a solution to this issue and no suggestion has worked. It seems a major oversight or I'm a complete dummy.
Simply, what I want to do is access the electron api from within the application, for example I would like a button that one could click to close, resize etc. the window via the BrowserWindow object from within the render/preload scripts.
I am compiling it via electron forge w/ webpack from example repo provided by electron forge (as opposed to separate webpack), I have nodeIntegration: true
, contextIsolation: false
and enableRemoteModule: true
, the package.json
also has these options set.
This is the starting project I've used: https://www.electronforge.io/config/plugins/webpack
From reading other tickets the generally recommended way is to require the remote
module via various methods, get the window object and close / execute your action. The issue being this always returns null
when using:
const remote = require('@electron/remote')
const remote = require('electron').remote
const { remote } = require('electron')
I've tried various sources but for example nothing in this ticket works: Atom Electron - Close the window with javascript
I also read this article that seems to say the remote
module was deprecated and is no longer used, however the code in that doesn't work either: https://www.npmjs.com/package/@electron/remote
I have created a git repo with the code I'm trying to use: https://github.com/MajorFailz/electron-problem-example
Please help! I can't really continue development on my project using electron if I can't control the application from within the application. I'm perfectly happy to accept if I've been dumb somehow and missed something vital or fundamental, but as I say it feels like these are the first things any electron noobie would need to know but I'm lost =/
Bonus points if you can provide me a demonstrable example of it working I could look at.
Thanks in advance!
Edit: versions from package
...ANSWER
Answered 2021-Dec-16 at 16:26Thanks to @evolutionxbox 's comments I managed to fix this with the following.
npm run install --save @electron/remote
Then in main.js add the following line:
require('@electron/remote/main').initialize()
Then finally when you're creating your window in the main process add this:
require("@electron/remote/main").enable(mainWindow.webContents)
Now I'm getting the BrowserWindow object when I'm asking for it! Woop!
QUESTION
I just set up a basic electron-react app by using electron-forge and adding React+webpack+typescript per instructions and it all works great (I haven't added anything beyond the basic setup). It compiles well with all green checkboxes.
However, when I hit the close button by mouse clicking the x in the top right, it shuts down but gives the following error:
...ANSWER
Answered 2021-Sep-21 at 22:23I just ran into this today and managed to find a hint here
You have to bind to the Electron app
's window-all-closed
event if you don't want this to happen. Usually, you'd use this event to quit the app when all the windows are closed. Here's an example snippet from main.js
:
QUESTION
I am using electron app.setLoginItemSettings(settings) to enable my application to autostart at login. This is how I am implementing it:
...ANSWER
Answered 2021-Sep-22 at 14:30As I suspected, it was related to the unknown publisher
popup; so, when I edited the registry entry related to UAC
by using the following command line code shown below, the application started on boot.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-forge
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page