Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not a function #118

Open
ciaoamigoschat opened this issue Dec 15, 2023 · 2 comments
Open

TypeError: undefined is not a function #118

ciaoamigoschat opened this issue Dec 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ciaoamigoschat
Copy link

ciaoamigoschat commented Dec 15, 2023

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 ciaoamigoschat added the bug Something isn't working label Dec 15, 2023
@ciaoamigoschat
Copy link
Author

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 ?anon_0_ (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
Copy link
Author

NEWS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants