electron-forge | complete tool for creating publishing | Runtime Evironment library

 by   electron-userland TypeScript Version: v6.0.0-beta.63 License: MIT

kandi X-RAY | electron-forge Summary

kandi X-RAY | electron-forge Summary

electron-forge is a TypeScript library typically used in Server, Runtime Evironment, Angular, Nodejs, Electron applications. electron-forge has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

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

            kandi-support Support

              electron-forge has a medium active ecosystem.
              It has 4892 star(s) with 370 fork(s). There are 73 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 71 open issues and 902 have been closed. On average issues are closed in 116 days. There are 43 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of electron-forge is v6.0.0-beta.63

            kandi-Quality Quality

              electron-forge has 0 bugs and 0 code smells.

            kandi-Security Security

              electron-forge has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              electron-forge code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              electron-forge is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              electron-forge releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 81 lines of code, 0 functions and 218 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of electron-forge
            Get all kandi verified functions for this library.

            electron-forge Key Features

            No Key Features are available at this moment for electron-forge.

            electron-forge Examples and Code Snippets

            No Code Snippets are available at this moment for electron-forge.

            Community Discussions

            QUESTION

            Error: Failed to lookup view "home" in views directory
            Asked 2022-Apr-02 at 11:06

            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:06

            You need an express.static(...) statement somewhere in your app to serve the css and js files. How does that look? The following should work:

            Source https://stackoverflow.com/questions/71716326

            QUESTION

            app.on('open-url") event not being called on linux after deep linking to it
            Asked 2022-Mar-29 at 06:38

            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:38

            Figured 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:

            Source https://stackoverflow.com/questions/71444973

            QUESTION

            Cannot load inline font in Electron-Forge/Webpack
            Asked 2022-Mar-29 at 03:04

            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:05

            Finally fixed it...

            Electron-Forge installs a recent version of CSS-Loader, whereas the website still has quite an old version. Downgrading fixed the issue.

            Source https://stackoverflow.com/questions/68532968

            QUESTION

            Refused to connect to 'ws://localhost:3000/cpp' because it violates the following Content Security Policy directive:
            Asked 2022-Mar-26 at 20:38

            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:38

            WebpackPluginRendererConfig

            Source https://stackoverflow.com/questions/71631488

            QUESTION

            Build electron as exe on macbook m1
            Asked 2022-Mar-09 at 09:15

            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:15

            We 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:

            Source https://stackoverflow.com/questions/71343833

            QUESTION

            Run two instances of same Electron app locally at same time
            Asked 2022-Feb-02 at 21:02

            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:02

            Here'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.

            1. Start the first instance of the Electron app with npm start
            2. 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.

            Source https://stackoverflow.com/questions/70951214

            QUESTION

            Setting up sqlcipher in an electron app using electron-forge and webpack
            Asked 2022-Jan-21 at 15:17

            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:

            1. make sure that the folder node_modules/@journeyapps/sqlcipher/lib/binding/napi-v6-linux-x64 exists -> yes it exists

            2. 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:17

            Well, 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 solution

            First: 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.

            Warning

            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 files

            main.webpack.js

            Source https://stackoverflow.com/questions/70793089

            QUESTION

            Electron functions are inaccessible from within renderer/preload scripts even with recommended settings
            Asked 2021-Dec-16 at 16:26

            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:26

            Thanks 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!

            Source https://stackoverflow.com/questions/70382068

            QUESTION

            Electron Forge Error - cannot read property 'close' of undefined
            Asked 2021-Oct-17 at 02:51

            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:23

            I 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:

            Source https://stackoverflow.com/questions/69147561

            QUESTION

            Electron app not launching at windows startup
            Asked 2021-Sep-22 at 14:30

            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:30

            As 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.

            Source https://stackoverflow.com/questions/69259286

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install electron-forge

            Note: Electron Forge requires Node 12.13.0 (LTS) or above, plus git installed. If you have a more recent version of npm or yarn, you can use npx, or yarn create.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/electron-userland/electron-forge.git

          • CLI

            gh repo clone electron-userland/electron-forge

          • sshUrl

            git@github.com:electron-userland/electron-forge.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link