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

Error when launching signed and notarized app - JavaScript error occurred in the main process #185

Closed
michaelburris opened this issue Mar 14, 2024 · 6 comments

Comments

@michaelburris
Copy link

When launching an app that has been osx signed and notarized I get the following error:

Uncaught Exception:
Error: Knex: run
$ npm install sqlite3 --save
dlopen(/var/folders/..., 0x0001): tried: '/var/folders/....' (code signature in <> '.....' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '......' (no such file)

I'm hoping someone has had to deal with this using knex.js and electronjs. The app works fine when its not notarized and signed.

@Lsnsh
Copy link

Lsnsh commented Apr 2, 2024

+1 same problem.

@miketaheny
Copy link

Same problem here. Either of you come up with a resolution? @michaelburris @Lsnsh

@Lsnsh
Copy link

Lsnsh commented Apr 3, 2024

Same problem here. Either of you come up with a resolution? @michaelburris @Lsnsh

@miketaheny After setting com.apple.security.cs.disable-library-validation, worked normally for me.

<key>com.apple.security.cs.disable-library-validation</key>
<true/>

https://developer.apple.com/forums/thread/126895

@miketaheny
Copy link

miketaheny commented Apr 3, 2024

@Lsnsh - that worked thank you!

For anyone using electron forge this fixed the error with dlopen(.... different team Ids.

1. Add entitlements.plist to the root of your project.
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/> <key>com.apple.security.cs.disable-library-validation</key> <true/> <key>com.apple.security.cs.allow-jit</key> <true/> </dict> </plist>

2. In forge.config.js add this to osxSign:
optionsForFile: (filePath) => { // Here, we keep it simple and return a single entitlements.plist file. // You can use this callback to map different sets of entitlements // to specific files in your packaged app. return { entitlements: './entitlements.plist' }; }

@michaelburris
Copy link
Author

@miketaheny @Lsnsh Thank you. Works as advertised.

@artmoskvin
Copy link

thanks for providing the solution! does it mean that the default set of entitlements doesn't work? https://github.com/electron/osx-sign/tree/main/entitlements

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

No branches or pull requests

4 participants