Skip to content

RTCDataChannel undefined after registerGlobals() and LivekitReactNative.setup() #397

@sebastian-raaf

Description

@sebastian-raaf

Environment

Package Version
@livekit/react-native 2.11.0
@livekit/react-native-webrtc 144.1.0
@livekit/react-native-expo-plugin 1.0.2
@config-plugins/react-native-webrtc 13.0.0
livekit-client 2.19.1
expo 54.0.35
react-native 0.81.5
New Architecture disabled (newArchEnabled: false)
Build method EAS Cloud Build
Device iPhone 16 Pro, iOS 26.5

What happens

After calling both registerGlobals() and LivekitReactNative.setup(), RTCDataChannel is undefined while all other WebRTC globals are correctly registered:

registerGlobals();
console.log(typeof (global as any).RTCPeerConnection);  // "function" 
console.log(typeof (global as any).RTCDataChannel);     // "undefined"
console.log(typeof (global as any).MediaStream);        // "function"
console.log(typeof (global as any).RTCIceCandidate);    // "function"

Calling new Room() throws: TypeError: Cannot read property 'prototype' of undefined

Setup

registerGlobals() called at module level and at app entry point (_layout.tsx).

LivekitReactNative.setup() added to AppDelegate.swift — both manually and via
custom Expo Config Plugin. Verified present in built binary via npx expo prebuild.

newArchEnabled: false set at root level in app.json.

Key observation

Only RTCDataChannel is missing. All other WebRTC globals (RTCPeerConnection, MediaStream, RTCIceCandidate) are correctly registered. Not a general registerGlobals() failure.

Question

Is there a known issue with @livekit/react-native-webrtc@144.1.0 where RTCDataChannel is not exposed as a JS global?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions