Skip to content

React Native SDK crashes on Expo SDK 55 during initialization #358

@etx121

Description

@etx121

Summary

I'm trying to use @openpanel/react-native in an Expo React Native app, but the SDK crashes during initialization before the app renders.

Environment

  • @openpanel/react-native: 1.4.0
  • expo: 55.0.19
  • expo-constants: 55.0.15
  • expo-application: 55.0.14
  • react-native: 0.83.6
  • expo-router: 55.0.13
  • Package manager: pnpm@10.33.2
  • Setup: Expo app inside a pnpm monorepo

Setup

The required packages are installed in the mobile app:

@openpanel/react-native@1.4.0
expo-application@55.0.14
expo-constants@55.0.15

Initialization code:

import { OpenPanel } from "@openpanel/react-native";

export const op = new OpenPanel({
  clientId: process.env.EXPO_PUBLIC_OPENPANEL_MOBILE_CLIENT_ID,
  apiUrl: process.env.EXPO_PUBLIC_OPENPANEL_MOBILE_API_URL,
});

Error

On startup, the app crashes with:

ERROR  [TypeError: k.default.getWebViewUserAgentAsync is not a function (it is undefined)]

After that, Expo Router reports route warnings such as:

WARN  Route "./_layout.tsx" is missing the required default export.
WARN  Route "./index.tsx" is missing the required default export.

Those route warnings seem to be cascading from the SDK initialization error.

Additional Context

I checked expo-constants directly in the same app, and the helper appears to exist:

import Constants from "expo-constants";

console.log(typeof Constants.getWebViewUserAgentAsync);
// "function"

So the package is installed and the function is available when imported directly from app code.

The install also reports peer warnings:

@openpanel/react-native 1.4.0 unmet peer expo-application "5 - 7"
@openpanel/react-native 1.4.0 unmet peer expo-constants "14 - 18"

Expo SDK 55 uses expo-application@55.x and expo-constants@55.x.

Question

Is Expo SDK 55 currently supported by @openpanel/react-native?

If yes, is there anything specific needed for Expo SDK 55 / pnpm monorepo setups to avoid this initialization crash?

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