React Native SDK crashes on Expo SDK 55 during initialization
维护者通常 1 天内回复
评估
- 难度
- 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.0expo:55.0.19expo-constants:55.0.15expo-application:55.0.14react-native:0.83.6expo-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 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Openpanel-dev/openpanel 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
Openpanel-dev/openpanel#532 ·
维护者通常 1 天内回复
-
Period comparison badge shows wrong percentage for decreases (100 → 50 shows ↓100%)可能已有人在做 @sarmah-rup 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
Openpanel-dev/openpanel#526 ·
维护者通常 1 天内回复
-
Self-hosted missing op1-replay.js可能已有人在做 @houstona 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
Openpanel-dev/openpanel#512 · 1 条评论 ·
维护者通常 1 天内回复
-
login page needs refinement可能已有人在做 @anandghegde 于 24 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Openpanel-dev/openpanel#495 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
Openpanel-dev/openpanel#528 ·
维护者通常 1 天内回复
查看 Openpanel-dev/openpanel 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
siyuan-note/siyuan#20313 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
DevTools page styles leak into the host app in development可能已有人在做 @onmax 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
nuxt-modules/better-auth#567 · 1 条评论 ·
维护者通常 1 天内回复