pusher / pusher-websocket-react-native

React Native official Pusher SDK
MIT License
61 stars 52 forks source link

Error `Unable to resolve module @react-native-community/netinfo` #130

Open arpitv96171 opened 8 months ago

arpitv96171 commented 8 months ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? After installation of react-native-pusher-js using the command yarn add @pusher/pusher-websocket-react-native, when I bundle the ios app, the following error pops:

 Unable to resolve module @react-native-community/netinfo from /path-to-node_modules/pusher-js/dist/react-native/pusher.js: @react-native-community/netinfo could not be found within the project or in these directories:
  ../node_modules/pusher-js/node_modules
  ../node_modules

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar. As mentioned above

What is the expected behavior? No error

Which versions of Pusher, and which browsers / OS are affected by this issue? Did this work in previous versions of Pusher? If so, which?

"@pusher/pusher-websocket-react-native": "1.3.0" "@react-native-community/netinfo": "11.2.1"

benw-pusher commented 8 months ago

You may need into install netinfo as well.

npm install --save @react-native-community/netinfo

Can you confirm if this resolves the issue for you?

I'm not sure why this isn't listed as a dependency for automatic install though.