-
-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack plugin errors when using universal native node modules on macOS #3526
Comments
Seeing the same issue on Electron Forge 7.4.0. Downgrading to 7.2.0 fixes it. |
Treat this as a FYI comment. Also seeing this when the native library resides in a hidden directory, e.g.
This is due to I don't think this should be fixed though as published native libs in a hidden dir would typically not exist in the wild. In my case it was with my own native library build which was easily fixed by changing the build output dir. |
@instilled Thanks for the comment about the hidden directory! I use an npm package that expects a native library to be at a certain path relative to the JavaScript bundle. The Forge WebPack plugin places JavaScript bundles into a hidden directory Hence, I think this should be fixed. |
Update: Here's what caused the error in my case: I had a script to build a universal macOS It seems like Forge v7.3.0 introduced the ability to build universal macOS binaries with native dependencies without the need for an external build script. This broke my existing configuration. Removing the |
Related issue that has a PR: #3792 |
Pre-flight checklist
Electron Forge version
7.3.0
Electron version
27.3.5
Operating system
macOS 14.3.1 (23D60)
Last known working Electron Forge version
7.2.0
Expected behavior
A universal (
arm64
andx86
) native node module should not cause the error:I suspect this is related to the "magic native module mapping" done in #3437.
Actual behavior
The webpack build should not error when a native node module that is a universal binary is used.
Steps to reproduce
I don't have good steps to reproduce because it's a private repo, but using
node-mac-icloud-keyvalue
as a node dependency (which is publicly available) is what triggers the issue, since it's built as a universal binary.Using electron forge
7.2.0
does not exhibit the issue.Additional information
Relevant parts of my
forge.config.ts
look like this:The text was updated successfully, but these errors were encountered: