Openpanel-dev / Openpanel-dev/openpanel

React Native SDK crashes on Expo SDK 55 during initialization

Open
#358 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7k
Forks
481
Avg merge
1d 3h
Merged PRs (30d)
21

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the @openpanel/react-native OpenPanel initialization shown in the issue and reproduce the crash in an Expo SDK 55 app using the listed package versions. Compare the SDK's expo-constants import and peer dependency ranges with the direct app import. Done means initialization no longer throws getWebViewUserAgentAsync is not a function and the app renders without cascading route warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.