Skip to content

[react-native] Error connecting: "could not establish pc connection" #152

@thekiwi

Description

@thekiwi

I'm trying to use the ElevenLabs React Native SDK in my Expo app instead of the previous DOM approach. I have installed and configured it as described in the documentation. However, when attempting to start a call, I am receiving the following logs/errors (apologies for the verbosity, this was extracted from Sentry and manually redacted):

{
  "timestamp": 1754136333.264,
  "type": "default",
  "category": "console",
  "level": "info",
  "message": "publishing track [object Object]",
  "data": {
    "logger": "console",
    "arguments": [
      "publishing track",
      {
        "enabled": true,
        "kind": "audio",
        "muted": false,
        "pID": "PA_<redacted>",
        "participant": "user_agent_<redacted>",
        "room": "room_agent_<redacted>",
        "roomID": "RM_<redacted>",
        "source": "microphone",
        "streamID": "<redacted>",
        "streamTrackID": "<redacted>"
      }
    ]
  }
},
{
  "timestamp": 1754136348.418,
  "type": "default",
  "category": "console",
  "level": "debug",
  "message": "Disconnected from conversation",
  "data": {
    "logger": "console",
    "arguments": [
      "Disconnected from conversation"
    ]
  }
},
{
  "timestamp": 1754136348.419,
  "type": "default",
  "category": "console",
  "level": "error",
  "message": "LiveKit error: ConnectionError: could not establish pc connection",
  "data": {
    "logger": "console",
    "arguments": [
      "LiveKit error:",
      {
        "code": 1,
        "message": "could not establish pc connection",
        "name": "ConnectionError",
        "reason": 2,
        "reasonName": "InternalError",
        "stack": "ConnectionError: could not establish pc connection\n    at construct (native)\n    at apply (native)\n    at _construct (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:144148)\n    at Wrapper (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:143802)\n    at construct (native)\n    at _callSuper (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:2310092)\n    at Ts (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:2432150)\n    at construct (native)\n    at _callSuper (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:2310092)\n    at Os (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:2432265)\n    at anonymous (address at /private/var/containers/Bundle/Application/2D422554-001A-42FF-9EDE-E07FCE930192/testing.app/main.jsbundle:1:2469395)"
      }
    ]
  }
},
{
  "timestamp": 1754136348.422,
  "type": "default",
  "category": "console",
  "level": "error",
  "message": "Conversation error: could not establish pc connection",
  "data": {
    "logger": "console",
    "arguments": [
      "Conversation error:",
      "could not establish pc connection"
    ]
  }
}

I'm not using any custom configuration, my code is essentially just including <ElevenLabsProvider> in the root _layout.tsx and then using useConversation() followed by conversation.startSession({ agentId: ... }).

What does this error mean and how can I resolve it? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions