1,198 questions
355
votes
21
answers
170k
views
Electron: jQuery is not defined
Problem: while developing using Electron, when you try to use any JS plugin that requires jQuery, the plugin doesn't find jQuery, even if you load in the correct path using script tags.
For example,
...
252
votes
11
answers
256k
views
Electron require() is not defined
I'm creating an Electron app for my own purpose. My problem is when I'm using node functions inside my HTML page it throws an error of:
'require()' is not defined.
Is there any way to use Node ...
28
votes
2
answers
14k
views
NPM run * doesn't do anything
I was running an Electron project, and everything worked just fine. But now when I run any of the scripts in my package.json (including npm start), it just escapes a line and doesn't do anything.
My ...
31
votes
2
answers
91k
views
array.length is zero, but the array has elements in it [duplicate]
I'm currently in the process practicing using electron, but I'm quite new with javascript and I've come across a problem which has me completely baffled. I have the following code:
function ...
107
votes
6
answers
116k
views
How to use preload.js properly in Electron
I'm trying to use Node modules (in this example, fs) in my renderer processes, like this:
// main_window.js
const fs = require('fs')
function action() {
console.log(fs)
}
Note: The action ...
96
votes
4
answers
106k
views
How to access DOM elements in electron?
I am trying to add functionality to a button in index.html file is as follows:
I have a button element in index.html
<button id="auth-button">Authorize</button>
In main.js of the app, I ...
61
votes
5
answers
129k
views
Promise returned in function argument where a void return was expected
I'm working on an Electron application and I want to use async await in an anonymous function in my Main like this:
process.on("uncaughtException", async (error: Error) => {
await this....
227
votes
18
answers
248k
views
How to set app icon for Electron / Atom Shell App
How do you set the app icon for your Electron app?
I am trying BrowserWindow({icon:'path/to/image.png'}); but it does not work.
Do I need to pack the app to see the effect?
57
votes
7
answers
29k
views
bundling precompiled binary into electron app
Is there a good solution on how to include third party pre compiled binaries like imagemagick into an electron app? there are node.js modules but they are all wrappers or native binding to the system ...
113
votes
10
answers
136k
views
How to use sqlite3 module with electron?
I want to develop desktop app using electron that uses sqlite3 package installed via npm with the command
npm install --save sqlite3
but it gives the following error in electron browser console
...
108
votes
25
answers
488k
views
How do I reload a page with react-router?
I can see in this file (https://github.com/ReactTraining/react-router/blob/v0.13.3/modules/createRouter.js) that there is a refresh function but I have no idea how to call it. I'm fairly new to react-...
87
votes
13
answers
126k
views
How to deploy an Electron app as an executable or installable in Windows?
I want to generate a unique .exe file to execute the app or a .msi to install the application. How to do that?
263
votes
2
answers
377k
views
How to unpack an .asar file?
I have packed my Electron application using the following command:
asar pack app app.asar
Now, I need to unpack it and get the whole code back. Is there any way to do so?
82
votes
12
answers
48k
views
How can I force external links from browser-window to open in a default browser from Electron?
I'm using the BrowserWindow to display an app and I would like to force the external links to be opened in the default browser. Is that even possible or I have to approach this differently?
69
votes
3
answers
138k
views
Saving files locally with electron
I have some template files that contain a few variable strings each, I'd like to build a very simple input form with Electron (https://www.electronjs.org/) and I want to save the composed output file ...