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

context-aware error in electron 9.10 node 12.14.1 #89

Open
grofit opened this issue Jul 15, 2020 · 10 comments
Open

context-aware error in electron 9.10 node 12.14.1 #89

grofit opened this issue Jul 15, 2020 · 10 comments

Comments

@grofit
Copy link

grofit commented Jul 15, 2020

Just updated an old application to electron 9.10 and bumped node to match with the version listed on this repos readme, but every time the app loads it bombs out saying:

Error: Loading non-context-aware native module in renderer: '\\?\E:\Code\open-source\blah\node_modules\electron-edge-js\lib\native\win32\x64\12.14.1\edge_coreclr.node', but app.allowRendererProcessReuse is true. See https://github.com/electron/electron/issues/18397.

I noticed #76 which implies that this issue should be fixed, so do I need to do anything specific to get things running? (i.e make app.allowRenderProcessReuse = false?)

@grofit
Copy link
Author

grofit commented Jul 15, 2020

Just tried and app.allowRendererProcessReuse = false; does fix the problem (or at least side steps it) but they mention that in new electron versions they wont let you mess with this var

@Hammster
Copy link

Correct newer electron versions require edge-js to be properly context aware, I have a patch on this fork https://github.com/ArticySoftware/electron-edge-js I will try to merge that change including some stuff from #70 but at the moment we are still testing if everything works properly.

@buettner123
Copy link

Any progress here @Hammster ? Would like to hear about your experience after changing it to be context aware and if there is any chance to have a PR for it soon.

@Hammster
Copy link

Hammster commented Sep 15, 2020

Hey from our testing so far we have not found any issues. I can't really give an ETA for the PR though since currently the focus isn't on the C# <-> NodeJS layer and I'm occupied in other projects after work.

@nramage
Copy link

nramage commented Nov 11, 2020

@Hammster Any update on if/when edge-js will be properly context aware? Thanks for your work on this.

@agracio
Copy link
Owner

agracio commented Dec 29, 2020

Code has been updated to be context aware. Electron 11 binaries have been recompiled to fix the issue.

@agracio agracio closed this as completed Dec 30, 2020
@agracio agracio reopened this Jan 1, 2021
@agracio
Copy link
Owner

agracio commented Jan 2, 2021

Unfortunately the issue is more complex and making the module context aware introduced a new problem. It no longer unloads correctly when application is reloaded causing it to throw exception in underlying C++ code. Some clean-up code is now required but I haven't figured out where it should go.

@Hammster
Copy link

Hammster commented Jan 2, 2021

Have you checked if that also happens with the code from my fork?

@agracio
Copy link
Owner

agracio commented Jan 2, 2021

I have not seen any changes in your code besides ArticySoftware@b5d5167 which are identical to my code change.You can see the problem by using https://github.com/agracio/electron-edge-js-quick-start and hitting 'refresh' once Electron app is loaded, thrown assertion exception only hides underlying problem, even if assert check is removed the app fails to load after refresh.

@bmcbarron
Copy link

Howdy @agracio ! Any thoughts on what cleanup might be needed? I'm happy to contribute if you can give me a sense of where to look or how best to debug. These reload crashes are causing issues for me.

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

6 participants