tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
615 stars 112 forks source link

dns.lookup is not a function. (In 'dns.lookup', 'dns.lookup' is undefined) #46

Closed AdorkDean closed 7 years ago

AdorkDean commented 7 years ago

use rn-nodeify in webtorrent & react-native, console print 'dns.lookup is not a function. (In 'dns.lookup', 'dns.lookup' is undefined)'. cannot node dns module directly replace by dns.js? thanks.

mvayngrib commented 7 years ago

lookup is not supported, use resolve instead if you can. See https://nodejs.org/api/dns.html#dns_implementation_considerations

Under the hood, dns.lookup() uses the same operating system facilities as most other programs.

the currently used shim dns.js is pure javascript (not native). If you really need lookup, you'll need to implement a native shim