You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native+Expo Go运行报错:Property 'structuredClone'不存在

关于React Native + Expo Go下structuredClone报错的问题

环境信息

  • React Native版本:0.72.6
  • Expo版本:~49.0.15
  • TypeScript版本:^5.1.3
  • JS引擎:已在app.json中配置Hermes

问题重现流程

  • 执行npm run android启动应用
  • 终端按s切换到Expo Go模式
  • 通过扫码在安卓真机打开应用,或在Pixel 6(Android API 34)模拟器运行
  • 进入使用structuredClone的页面时,应用崩溃,报错Property 'structuredClone' doesn't exist

注:使用默认开发构建运行时一切正常

疑问点

  1. 如何选择具体的JS引擎版本?
  2. 开发模式与Expo Go运行有何差异,为何仅在Expo Go下出现该报错?

需求咨询

希望继续使用Hermes,请问:

  • 能否为structuredClone添加polyfill?
  • 使用JSON.parse(JSON.stringify(myObject))这类替代方法是否可行?

附app.json配置代码

{
  "expo": {
    "name": "my-app",
    "slug": "my-app",
    "jsEngine": "hermes",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.myname.myapp"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

内容的提问来源于stack exchange,提问作者Cooty

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 13:05:20