balthazar / react-native-zeroconf

:satellite: Discover Zeroconf services using react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'scan' of undefined

jasenkabalac opened this issue · comments

I'm using your sample app in Expo .
zeroconf.scan('http', 'tcp', 'local.') is not working

I am having the same issue. I am not using Expo and am using React Native v0.61.2 and react-native-zeroconf v0.11.4.

Hey @jasenkabalac restarting my metro bundler worked for me!

I get the same error when trying to expo start --web or run it on my iOS device in the expo go app.
I tried restarting the project from scratch and restarting the IDE. I still get the same error.
image
image

While when I console.log(zeroconf) it's not undefined or null, and zeroconf.scan is not null either.
But when I add parentheses it throws that error and I don't know what to do.

Expo doesn't work with native modules, there's plenty of issues about this already