I have built an Electron application which works properly when running from command-line using:
npm start
I want to deploy the application as user-friendly installers for Mac/Windows/Linux. To achieve this I am using Electron-Builder for packing and building my source files. The command I use to execute the build process is: npx electron-builder.
When I try to run my packaged and built application, I immediately receive an error message stating:
A Javascript error occurred in the main process
Uncaught Exception:
TypeError: Callback is not a function
at ELECTRON_ASAR.js:600:9
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
screenshot of error message
After clicking OK on the pop-up, the application runs as expected.
I also receive this message if I use the npm start command after building with npx electron-builder.
I have tested on both Mac and Linux and I receive the same message. I have even tested with an empty electron project (no custom code or dependencies) and I still receive this message. Therefore I assume that it is a problem with Electron-Builder.
Any ideas as to how I can stop this error message from popping up at the start of runtime?
Thanks.