Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

React Native SDK crashes on Expo SDK 55 during initialization

未关闭
#358 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@grootbro 已经在做这个了。

开始于 2026年9月7日。

  • #487 来自 @grootbro —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
技术栈
react-native, typescript
领域
mobile

调研方向

从 issue 中显示的 @openpanel/react-native OpenPanel 初始化开始,使用列出的软件包版本在 Expo SDK 55 应用中复现崩溃。将 SDK 的 expo-constants 导入和 peer dependency 范围与应用中的直接导入进行比较。当初始化不再抛出 getWebViewUserAgentAsync is not a function,且应用在没有级联 route 警告的情况下完成渲染时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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: [email protected]
  • Setup: Expo app inside a pnpm monorepo

Setup

The required packages are installed in the mobile app:

@openpanel/[email protected]
[email protected]
[email protected]

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 [email protected] and [email protected].

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?

主要语言
TypeScript
星标
7.1k
派生
510
平均合并
7 天 2 小时
30 天内合并 PR
7

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Openpanel-dev/openpanel 的其他 Issue

查看 Openpanel-dev/openpanel 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。