electron-typescript-react icon indicating copy to clipboard operation
electron-typescript-react copied to clipboard

Packaged app can't find preload.js

Open dustatron opened this issue 3 years ago • 1 comments

After running yarn package the resulting app returns error renderer_init.js:93 Unable to load <path>/preload.js However, in development the bridge.ts / preload file loads and can execute node commands without issue.

I poked around with the settings but I have not figured out a solution for this issue.

Link to my code. https://github.com/dustatron/video-converter

dustatron avatar Sep 27 '21 18:09 dustatron

I just had (other) build issues, too. What helped me was to update the electron dependencies – electron is two major versions ahead, and electron-forge has some minor fixes. I tested it with your codebase and got it built and running without errors.

yarn add --dev electron@latest @electron-forge/cli@latest @electron-forge/maker-deb@latest @electron-forge/maker-rpm@latest @electron-forge/maker-squirrel@latest @electron-forge/maker-zip@latest @electron-forge/plugin-webpack@latest

This sadly spawns a new build error in node_modules/fluent-ffmpeg/index.js, that is discussed here. As a quick fix I just deleted the if/else require lib-cov there. Hopefully you can fix it more robustly. Good luck.

timohausmann avatar Oct 12 '21 17:10 timohausmann