首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >react-本机0.57.1包尝试分配值以只读属性“未定义”失败

react-本机0.57.1包尝试分配值以只读属性“未定义”失败
EN

Stack Overflow用户
提问于 2018-10-09 12:56:07
回答 1查看 443关注 0票数 0

在发布CodePush版本时,我遇到了这个问题。

代码语言:javascript
复制
$ appcenter codepush release-react \
  --deployment-name=Staging \
  --token=$APPCENTER_ACCESS_TOKEN \
  --description "$(git show -q)" \
  --disable-duplicate-release-error \
  --app=$APP_NAME

| Getting app info.../ Getting app info...- Getting app info...\ Getting app info...| Getting app info...Detecting android app version:

Using the target binary version value "0.0.1" from "android/app/build.gradle".

Running "react-native bundle" command:

node node_modules/react-native/local-cli/cli.js bundle --assets-dest /tmp/code-push11899-237-hv244s.pd3u/CodePush --bundle-output /tmp/code-push11899-237-hv244s.pd3u/CodePush/index.android.bundle --dev false --entry-file index.js --platform android

Cannot assign to read only property 'undefined' of object '#<Object>'
TypeError: Cannot assign to read only property 'undefined' of object '#<Object>'
    at buildBundle$ (/home/circleci/repo/node_modules/react-native/local-cli/bundle/buildBundle.js:39:10)
    at tryCatch (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:114:21)
    at tryCatch (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:62:40)
    at invoke (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:152:20)
    at /home/circleci/repo/node_modules/regenerator-runtime/runtime.js:187:11
    at new Promise (<anonymous>)
    at callInvokeWithMethodAndArg (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:186:16)
    at AsyncIterator.enqueue [as _invoke] (/home/circleci/repo/node_modules/regenerator-runtime/runtime.js:209:13)

Error: Failed to release a CodePush update.
Exited with code 3

我已经进行了一些探索,但前面提到的行似乎指向了https://github.com/facebook/react-native/blob/master/local-cli/bundle/buildBundle.js#L39,这是一个简单的NODE_ENV覆盖:

代码语言:javascript
复制
  process.env.NODE_ENV = args.dev ? 'development' : 'production';

你知道这个问题是从哪里来的吗?

以下是更多信息:

代码语言:javascript
复制
node:8.10
yarn install v1.5.1
appcenter-cli@1.1.4
"react-native": "0.57.1",
"react-native-code-push": "^5.4.0",

更新

我将其缩小到以下命令失败:

代码语言:javascript
复制
./node_modules/.bin/react-native bundle --platform android --dev false --reset-cache --entry-file index.js --bundle-output ./android/app/build/generated/assets/react/release/index.android.bundle --assets-dest ./android/app/build/generated/res/react/release

    Cannot assign to read only property 'undefined' of object '#<Object>'

TypeError: Cannot assign to read only property 'undefined' of object '#<Object>'
    at buildBundle$ (/Users/chanto/Apps/mobile-app/node_modules/react-native/local-cli/bundle/buildBundle.js:39:10)
    at tryCatch (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:114:21)
    at tryCatch (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:62:40)
    at invoke (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:152:20)
    at /Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:187:11
    at new Promise (<anonymous>)
    at callInvokeWithMethodAndArg (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:186:16)
    at AsyncIterator.enqueue [as _invoke] (/Users/chanto/Apps/mobile-app/node_modules/regenerator-runtime/runtime.js:209:13)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-10 09:03:20

升级反应-本土0.57.2解决了我的问题。

#wonderfulbump

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52721623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档