Пакет act-native 0.57.1 ​​не удается назначить значение только для чтения, свойство 'undefined'

Когда я выпускаю релиз CodePush, я сталкиваюсь с этой проблемой.

$ 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 перезапись:

  process.env.NODE_ENV = args.dev ? 'development' : 'production';

У вас есть идеи, откуда эта проблема?

Вот больше информации:

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",

Обновить

Я сузил это до следующей неудачной команды:

./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)

1 ответ

Обновление до реакции-родной 0.57.2 решило мою проблему.

#wonderfulbump

Другие вопросы по тегам