balthazar / react-native-zeroconf

:satellite: Discover Zeroconf services using react-native
MIT License
211 stars 96 forks source link

Zeroconf.scan_TypeError: Cannot read property 'scan' of null #183

Open 6ase opened 2 months ago

6ase commented 2 months ago

Good day!

const zeroconf = new Zeroconf(); zeroconf.scan('http', 'tcp', 'local.');

When i try to call . scan i have an error :

TypeError: Cannot read property 'scan' of null

Using Expo, try to do in Expo Go and on Production build. Can`t understand why that happend... Anyone can help? Also if i console.log(zeroconf) before scan i see the next object:

LOG {"_dListeners": {"error": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "found": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "published": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "remove": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "resolved": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "start": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "stop": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}, "unpublished": {"context": undefined, "listener": [Function anonymous], "remove": [Function remove]}}, "_events": {}, "_eventsCount": 0, "_maxListeners": undefined, "_publishedServices": {}, "_services": {}},