Open JeroenMBooij opened 6 days ago
Have you tried running your app with --inspect
or --inspect-brk
command line args and debugging breakpoints from there? I'd imagine some error is being thrown in the packaged app as this sounds like a local environment setup issue.
@mmaietta yes, when I run the production executable with devtools enabled I get an error in the console saying Cannot find module 'mypath\win-unpacked\resources\app.asar\preload.js
I probably have to use some electron-builder configuration to properly use the preload.js, but I don't know how.
My win-unpacked folder does have a folder resources and a file app.asar, but since this is a file it cannot contain preload.js
Can you share a minimum reproducible repo for this? Sounds like the wrong path is being passed to a require/import
Additional note: app.asar
is an archive that can be extracted with npx asar e <asar path> <extract folder>
to check the resources. preload.js
should be in there and the asar is the root from which to require the preload.js from.
I have an Angular app in Electron. When I add a preload.js file for inter process communication (IPC) the production build of the app is stuck on the index.html and the electron app is stuck and doesn't start up. For the development build I serve the electron app with a URL, localhost:4200 and it works without issues.
File structure (simplified for conciseness)
I have an electron app that is wrapping a Angular app and I use electron-build to build the app
package.json
electron-builder.json