-
Notifications
You must be signed in to change notification settings - Fork 44
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
Mocha - Error: Module did not self-register #23
Comments
@mmaietta hmm - this is only intended for use on macOS. I can try to poke at it to make sure it doesn't fall over on different platforms but i just assumed no one would try 😅 Your general approach is crudely correct but i might tweak it a bit - you're also welcome to send a PR if you're so inclined! |
I found a better route! I have a local solution already done. Created a fork of this repo so I should have a PR ready by end of tomorrow 🙂 Note: the conditional binding is great because it allows us to retain typesafety of the import, as opposed to using a dynamic import in my local code which creates a Promise and then I can't use things like |
…mport for things like `permissions.AuthType` as function params with a generic import that is platform-agnostic. Enhancement and fixes: codebytere#23 Adding additional test to run on a separate linux node
…mport for things like `permissions.AuthType` as function params with a generic import that is platform-agnostic. Enhancement and fixes: codebytere#23 Adding additional test to run on a separate linux node
…mport for things like `permissions.AuthType` as function params with a generic import that is platform-agnostic. Enhancement and fixes: codebytere#23 Adding additional test to run on a separate linux node
…mport for things like `permissions.AuthType` as function params with a generic import that is platform-agnostic. Enhancement and fixes: codebytere#23 Adding additional test to run on a separate linux node
I have integrated node-mac-permissions and am receiving an error when trying to test my app in a headless docker container run
Error:
I was able to narrow down the issue to the binding.gyp -> sources entry.
There's no source/export provided for the permissions target for windows or Linux, which in the docker case, is causing the module to not "self-register".
Resources used:
https://stackoverflow.com/a/41283828
https://stackoverflow.com/a/55177338
I was able to solve it with this small patch that just creates a stub
permissions.cc
with empty export for win/linux sourcesI'm honestly not familiar with NAPI, and I'm not sure if the empty module export is correct. Alternatively, one could simply stub a function for every entry and just returns "authorized". A for-loop could easily improve it, but the approach, in general, feels messy to me.
At the end of the day, I'm assuming I'm configuring something wrong considering how well maintained this project is (and thank you for it!)
Is
node-mac-permissions
supposed to be imported/required conditionally based onprocess.platform
or something in the code?The text was updated successfully, but these errors were encountered: