agnat / node_mdns

mdns/zeroconf/bonjour service discovery add-on for node.js
http://agnat.github.com/node_mdns
MIT License
868 stars 145 forks source link

Module not "context aware" - cannot be used in Electron #242

Open jthrilly opened 4 years ago

jthrilly commented 4 years ago

Hi!

This module will shortly become unusable in Electron projects due to it not being "context aware": https://nodejs.org/api/addons.html#addons_context_aware_addons

This will result in use of the module in the renderer emitting a warning such as:

Error: Loading non-context-aware native module in renderer

See here for further details: https://github.com/electron/electron/issues/18397

As of Electron 9, this can be worked around by using app.allowRendererProcessReuse = false, but this option will be removed soon.

I'm unsure how much work is required to make the module context aware, but I wanted to post this issue as a starting point, and a reference for others who may encounter this.