Description
Application built by running electron-builder
in a yarn workspace from repository root is broken.
Runtime dependencies are missing; it seems that node_modules
are not crawled during build at all.
Suspected cause in #8571.
Here is a reproduction example with branches for latest vs. last stable version (26.0.3).
Notes
I used is-odd
as a simplest possible dependency, but I think the usecase is mainly for packages with native code.
I first discovered the problem with blake-hash
package; our project uses Webpack for all of main, renderer and preload processes, so all JS-only packages are bundled, and only the native code packages remain as runtime requires, and get packed into app.asar.unpacked
.
Nevertheless, the problem is reproducible with any runtime require, even though is-odd
goes to app.asar
and not app.asar.unpacked
.
Possible duplicates
Possible duplicates of this issue, but they don't provide that much information so I can't tell 100%:
Also related to yarn workspaces, but internal import instead of external, so I don't believe it's the same thing: