nats.ws icon indicating copy to clipboard operation
nats.ws copied to clipboard

NatsError: TIMEOUT for react native Android

Open t2b-dev-mobile opened this issue 8 months ago • 3 comments

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.

t2b-dev-mobile avatar Oct 30 '23 17:10 t2b-dev-mobile

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.

aricart avatar Nov 02 '23 19:11 aricart

Please check this issue, you will probably find your solution

https://github.com/nats-io/nats.ws/issues/195#issuecomment-1544717497

kindapath avatar Nov 21 '23 17:11 kindapath

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

t2b-dev-mobile avatar Feb 16 '24 20:02 t2b-dev-mobile