client-sdk-react-native icon indicating copy to clipboard operation
client-sdk-react-native copied to clipboard

Missing crypto module in React Native

Open incleaf opened this issue 11 months ago • 0 comments

Describe the bug

room.localParticipant.sendText throws an error while referencing native crypto module, which does not exist in React Native.

Reproduction

<Button
  onPress={async () => {
    console.log("onPress");
    try {
      const result = await room.localParticipant.sendText(
        "hello",
        {
          topic: "test_topic",
        }
      );
      console.log("result", result);
    } catch (e) {
      console.log(e);
    }
  }}
/>

output

 (NOBRIDGE) LOG  onPress
 (NOBRIDGE) LOG  [ReferenceError: Property 'crypto' doesn't exist]

Logs


System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1 Pro
    Memory: 626.16 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - /usr/local/bin/node
    Yarn: 1.22.22 - ~/.npm-global/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 134.0.6998.119
    Safari: 18.0
  npmPackages:
    @livekit/react-native: ^2.6.5 => 2.6.5 
    @livekit/react-native-expo-plugin: ^1.0.1 => 1.0.1 
    @livekit/react-native-webrtc: ^125.0.9 => 125.0.9

Severity

serious, but I can work around it

Additional Information

No response

incleaf avatar Mar 25 '25 18:03 incleaf