nats.ws
nats.ws copied to clipboard
NatsError: TIMEOUT for react native Android
What version were you using?
VERSION = '1.11.2'; LANG = 'nats.ws';
What environment was the server running in?
*Android Emulator: Pixel 3A Actual Android Devices: *Samsung Galaxy J5 Prime. *Samsung A13
Is this defect reproducible?
"react-native": "0.70.8"
here is the code snippet that has been used to connect to the server.
connect({
servers: wss://app.mydomain.com/ws
noEcho: true,
token: "Some String"
})
Given the capability you are leveraging, describe your expectation?
Using the Above snippet and the client library version, I am able to connect to the server through iOS devices and iOS emulators but not able to connect using Android devices.
Given the expectation, what is the defect you are observing?
While trying to connect using Android, the following error has been faced: "reader closed [TypeError: Object is not async iterable]" (This error has been consoled from the nats.js file) [NatsError: TIMEOUT]: This is been consoled from the catch block of connect execution.
This issue is possibly for nats.ws, currently we don't support react native directly - I know of folks that have used it but not sure what the patching is to get it to work.
Please check this issue, you will probably find your solution
https://github.com/nats-io/nats.ws/issues/195#issuecomment-1544717497
it get resolved by polyfil with this approach https://stackoverflow.com/questions/77348256/timeout-error-in-nats-client-connectivity-for-react-native-android-only/77939606#77939606