taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

WS doesn't work with re-natal and react native #361

Closed Pederaugust closed 4 years ago

Pederaugust commented 4 years ago

when setting :type :auto re-natal/react-native produces a cryptic error message

console.error: "ERROR [taoensso.sente:1090] - WebSocket error: [object Object]"

error
    YellowBox.js:59:8
dispatchEvent
    event-target.js:172:43
<unknown>
    WebSocket.js:286:10
emit
    EventEmitter.js:182:12
__callFunction
    MessageQueue.js:366:47
<unknown>
    MessageQueue.js:106:26
__guard
    MessageQueue.js:314:10
callFunctionReturnFlushedQueue
    MessageQueue.js:105:17
callFunctionReturnFlushedQueue
    [native code]:0

It does however not do that when setting to :ajax manually. This appears to be a sente problem not react native.

evelant commented 4 years ago

There are a few PRs waiting to fix this but unfortunately they've gone unmerged for many months now.

There's a workaround here: https://github.com/ptaoussanis/sente/pull/357#issuecomment-630316520

ptaoussanis commented 4 years ago

Should be fixed in current alpha, apologies for the delay.

pushpankar commented 3 years ago

I am compiling react native component as npm module using shadow-cljs. And using the sente 1.16.0 but getting the same error

console.error: "ERROR [taoensso.sente:1090] - WebSocket error: [object Object]"

Is there a work around ?