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

fix: 'non-context-aware' error for Electron #387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiewh7
Copy link

@xiewh7 xiewh7 commented Mar 4, 2022

fix: 'non-context-aware' error for Electron

Description

The latest releases of Electron prevent "non-context-aware" native modules. By Replacing NODE_MODULE with NAN_MODULE_WORKER_ENABLED this fixes the errors for Electron.

@marcelblum
Copy link
Contributor

The problem is lack of cleanup, doing location.reload() or advancing to any different html page crashes, and doing iohook.unload() often crashes.

@marcelblum
Copy link
Contributor

You can see my experiments towards this end at https://github.com/marcelblum/iohook but I didn't get very far and ended up needing to use Electron pre-v14 anyway.

@xiewh7
Copy link
Author

xiewh7 commented Mar 6, 2022

@marcelblum But we need to use Electron V16. How can we fix this problem in Electron after-v14?

@marcelblum
Copy link
Contributor

I'm not sure, I probably don't have the c++ expertise to solve this, but like I said you can see what progress I made towards it in my fork. If you don't ever need to do a reload() or load a different html page in the same renderer BrowserWindow then the problem can probably be ignored...

@sonukapoor
Copy link

@WilixLead / @Djiit Can you help with the above PR? I am not familiar with C++, to help out. It would be great though if we can get this working again. Electron is currently at version 21.

@lacymorrow
Copy link
Collaborator

Hi is this still a relevant change? We can merge it if so.

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 this pull request may close these issues.

4 participants