livekit / client-sdk-react-native

Official React Native SDK for LiveKit.
https://livekit.io
Apache License 2.0
110 stars 30 forks source link

Conflict between livekit/client-sdk-react-native and sfs2x-api Causing Connection #119

Closed ciaoamigoschat closed 5 months ago

ciaoamigoschat commented 9 months ago

Hi everyone, I'm encountering an issue while integrating livekit/client-sdk-react-native. When attempting to establish a connection to the server, there seems to be a conflict with other JavaScript libraries (sfs2x-api) that utilize WebSocket.

Upon trying to connect to the server, I'm receiving this error message: "TypeError: undefined is not a function". I believe this problem might be caused by global function registration.

ciaoamigoschat commented 9 months ago

Error Connecting to Room TypeError: (intermediate value).finally is not a function at new os (livekit-client.umd.js:1:162781) at Ao. (livekit-client.umd.js:1:300750) at Generator.next () at o (livekit-client.umd.js:1:59724) at s (sfs2x-api.js:7:98427) at sfs2x-api.js:7:98572 at c (sfs2x-api.js:7:97286) at tryCallOne (core.js:37:12) at core.js:123:15 at JSTimers.js:247:18

davidliu commented 9 months ago

Do you have a small example I could check this against? I'm not familiar with sfs2x-api.

ciaoamigoschat commented 9 months ago

It's very simple! Just install the APIs with "yarn add sfs2x-api" and then include them in the project using the statement import * as SFS2X from "sfs2x-api"

ciaoamigoschat commented 9 months ago

You just need to import the library to simulate the error:typeError, etc.

davidliu commented 9 months ago

Not sure if there's anything we can do here. Can't really tell what's going on with their code and how it's interacting with ours. If they're overriding global functions, that's not something we can really prevent or handle.