Skip to content
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

AutoUnpackNativesPlugin fails to unpack native modules from hidden directories #3792

Open
3 tasks done
glowingjade opened this issue Dec 25, 2024 · 2 comments · May be fixed by #3793
Open
3 tasks done

AutoUnpackNativesPlugin fails to unpack native modules from hidden directories #3792

glowingjade opened this issue Dec 25, 2024 · 2 comments · May be fixed by #3793

Comments

@glowingjade
Copy link

glowingjade commented Dec 25, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.6.0

Electron version

33.2.1

Operating system

macOS 15.2

Last known working Electron Forge version

No response

Expected behavior

AutoUnpackNativesPlugin should ensure all native modules are added to asar.unpack, regardless of their location.

Actual behavior

Native modules located in the .webpack directory are not being unpacked because the current pattern **/*.node doesn't match files in dot-prefixed directories.

Steps to reproduce

  1. Create a new project using template-webpack-typescript (https://www.electronforge.io/templates/typescript-+-webpack-template)
  2. Install and integrate native modules into the project

Additional information

The AutoUnpackNativesPlugin implementation needs to be updated here:
https://github.com/electron/forge/blob/main/packages/plugin/auto-unpack-natives/src/AutoUnpackNativesPlugin.ts#L26

The current glob pattern **/*.node should be replaced with either:

  • **/{.**,**}/**/*.node
  • **/{.webpack,**}/**/*.node

to properly handle modules in hidden directories.

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Dec 25, 2024

Seems simple enough, PRs welcome 👍

@glowingjade
Copy link
Author

I have opened a PR:
#3793
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants