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
Cannot import mdns from a Worker #258
Comments
For what it's worth, I have isolated the error as arising from the import statement itself (a simple console log statement afterward never gets executed). |
Here's the associated stack trace (sorry I forgot it earlier):
|
In case it helps, here's what the TS compiles to:
|
Another interesting data point: Our project had been importing the module in the main thread (creating an Advertisement) as well as in the worker thread. When I comment out the import from the main thread and stub out the calls, the import works in the worker thread (tested a few times now without any error...I see both the log message before and after the import). |
Hi @bguezzie, Thanks! |
I am trying to use mdns from inside of a Node.js Worker, but when I do I get the following error:
Module did not self-register: '/<...snipped...>/node_modules/mdns/build/Release/dns_sd_bindings.node'.
The import statement (written in TypeScript) is:
import mdns, {Browser, Service} from "mdns";
When I do this from the main thread, it works like a charm. I have done all the usual npm/node_modules tricks online trying to resolve and/or rebuild the library, but no dice.
OS: MacOS 12.5.1
Node: 18.9.0
mdns: 2.7.2
Please let me know what other information would be helpful here.
The text was updated successfully, but these errors were encountered: