livekit / client-sdk-react-native

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

TypeError: undefined is not a function #118

Open ciaoamigoschat opened 11 months ago

ciaoamigoschat commented 11 months ago

Hello everyone,

I'm encountering an error while attempting to connect to a room using the LiveKit library in React Native. Here's the code I'm using:


const [room] = useState(() => new Room({
    adaptiveStream: { pixelDensity: 'screen' },
}));
  try {
            await room.connect(liveKitUrl,liveKitToken);
        } catch (error) {
            console.log ("onLiveKitConnect error:" ,error)
        }

However, during the execution of this code, I'm receiving the error "[TypeError: undefined is not a function]". This error seems to occur when I try to call the connect() function on the room object.

Versions Used:

React Native: 0.71.3 LiveKit libraries: @livekit/react-native: 1.4.1 @livekit/react-native-webrtc: 114.0.0 I've verified the correctness of the URL and token required for the connection, but I haven't been able to resolve this issue. If anyone has encountered a similar situation or has suggestions on how to resolve this error, I would greatly appreciate any help.

Thank you very much!

ciaoamigoschat commented 11 months ago

onLiveKitConnect error: 'TypeError: undefined is not a function\n at os (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:141135:17)\n at ?anon0 (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:146493:72)\n at next (native)\n at o (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:136359:21)\n at s (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:130645:103)\n at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:130649:36)\n at c (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:130555:18)\n at tryCallOne (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:16)\n at anonymous (/Users/distiller/react-native/sdks/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:27)\n at apply (native)\n at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:25978:26)\n at _callTimer (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:25897:17)\n at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:25927:17)\n at callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:26090:44)\n at callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:2411:46)\n at anonymous (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:2223:45)\n at guard (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:2395:15)\n at flushedQueue (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:2222:21)\n at callFunctionReturnFlushedQueue (http://localhost:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.MyApp:2207:33)'

ciaoamigoschat commented 11 months ago

NEWS?