Our great sponsors
-
vite-electron-builder
Discontinued Secure boilerplate for Electron app based on Vite. TypeScript + Vue/React/Angular/Svelte/Vanilla
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
This is literally like my 13th attempt trying to build this electron + react app. On the first attempt I started with this boilerplate code and actually got everything working in dev mode (by somehow doing a hacky import of ipcRenderer directly in one of my react components, spaghetti code left and right, etc.) but as soon as I tried to build/package the app into an executable with electron-builder the goddamn thing wouldn't even start. I kept getting so many errors. And when I would "fix" one, another one would appear. I tried so many "solutions" that were posted on stackoverflow and even asked ChatGPT and the only answers I got were vague "make sure your imports are declared correctly and make sure the context is correct, etc." which I couldn't seem to sort out in my mess of a project. So I decided to say fuck it and just start fresh with a different electron + react boilerplate/template and simply copy over my react components and figure it out from there.
Well, now I've tried so many "fresh starts" with different boilerplate electron code from github and each time it's the same thing: the compiled app wouldn't even start (and sometimes I couldn't even get it to work in dev mode). So fast forward to now, I'm on this boilerplate code and I seem to have done the ipcRenderer and contextBridge stuff correctly as per the electron docs.