I am new to JS/Electron. I’m trying to create an Electron App, my Electron App has several charts, I am using LightningChart JS for my charting. The LightningChart API asks my to target a div, then it apparently inserts a canvas into the div upon which it draws. My application stacks 5-10 charts in a vertical column. I would like
Tag: electron
Loading local resources in an Electron App with a React frontend
I am working on an Electron App with a React front end that is aimed at performing some video tasks. At the moment, I am loading a video file on the backend, converting that to a base64 data format and then sending that to the React front end to use that as the source for the video player. This works
How do I wait to update an HTML header until promise is resolved?
I am building my first electron application and I am running into a JS error I am not sure how to fix. I have managed to setup the IPC for a basic password manager application. The use-case is simple: I click an HTML button and the frontend connects to the backend and delivers a keyword from which to build a
Replacing JS require(‘…’) with ESM imports
After updating node-fetch to v3, the following JavaScript error message appears when trying to launch my Electron app: Uncaught Exception: Error [ERR_REQUIRE_ESM]: require() of ES Module (…) not supported. Instead change the required … to a dynamic import() … I have found here that I should replace with: But how to replace in the same fashion the following? Answer Typically,
When writing to a json file, the writing isn’t fully overwriting the previous data
I am attempting to take some data from a JSON file, alter that data and overwrite the data of the original file with that new and altered data however when writing back to the file, some old data is being left behind. My js code for reading, altering, and writing the files are as follows: I am using electron with
Electron Amplify AppSync “Realtime disabled when in a server-side environment”
I’m using amplify appsync in my electron app and all works except for the realtime events which means my app doesn’t get signalled when the data changes in the cloud. I know this is because it’s running in Node which is what amplify is looking for (JS.browserOrNode) however I don’t know how to fix it. Can someone advise me how
document.getElementById(“myFile”).value gets undefined using electron
I have a very basic html file (using electron); and an event listener named render.js; But when I click submit, document.getElementById(“myFile”).value returns undefined how can I pull that value? Answer This is an interesting issue that confronts many people using Electron. One could either use (via Electron) the native OS dialog.showOpenDialog([browserWindow, ]options) dialog or the html <input type=”file”> tag. To
Sending message from Main to Renderer
Could someone help me out here. I’m completely confused on how to solve this. I’ve now spent about a week trying to find a solution for this but have come up short and there appears to be a lack of a solid solution online. I’ve made a github repository trying to demonstrate the issue. In short I’ve implemented a status
Electron “ready-to-show” event not working as expected
Here is a block of code from my application Codey. src/main.py src/docs/renderer.js When darkMode = true, toggleDarkMode is never run. My application has two different windows – an editor and a docs window. For both windows, on the “ready-to-show” event, “dark-mode:toggle” is sent to the renderer process. However, the docs window fails to run the toggleDarkMode function whilst it works
How to solve TypeError: Cannot read property ‘send’ of undefined in app.on
I have an error: TypeError: Cannot read propety ‘send’ of undefind on start of my program. How to correctly trigger app.on without errors? Answer I feel like this is probably a dupe of another question, but ipcRenderer cannot be used in the main process. See the docs which say: Process: Renderer If you want to send a message from the