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

The module "midi" is supposedly non-context-aware, despite being updated to support Electron. #35

Closed
Mister-SOSA opened this issue Jan 19, 2022 · 4 comments

Comments

@Mister-SOSA
Copy link

Mister-SOSA commented Jan 19, 2022

Forgive me if I'm making some sort of mistake, but I am trying to load easymidi into my Electron app. Upon requiring the package, I get the following error:

Uncaught Error: Loading non-context-aware native module in renderer: '\\?\C:\Users\my_user\Documents\Midi-App\midi-electron\node_modules\midi\build\Release\midi.node'. See https://github.com/electron/electron/issues/18397.

Upon further research, I see that midi was in fact updated to be context aware, and your wrapper does use the latest version, so what gives?

To reproduce the error, simply add const easymidi = require('easymidi'); to your main.js file before running npm start.

@dinchak
Copy link
Owner

dinchak commented Jan 19, 2022 via email

@Mister-SOSA
Copy link
Author

I'll try and wrestle with it and see what I can do to avoid this error. I'm not too familiar with context awareness, but I do know it involves thread management, per this article. And I do know that Electron no longer allows non-context-aware modules to be loaded into an application, per this issue. midi already adapted to this new standard, and your wrapper was updated to support it, so I'm not sure where the disconnect is. I'll try and fiddle with it a little more.

@dinchak
Copy link
Owner

dinchak commented Jan 19, 2022 via email

@Mister-SOSA
Copy link
Author

Upon further inspection, it appears that the original midi module was not successfully updated to support Electron's context-aware standards. It would seem that your module is fine, but fails to pass the new standards because the underlying module is essentially outdated. I'll close this issue and open one over there.

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

2 participants