appcenter-cli 2.3.0react-native 0.61.4Builds on Windows fail with error spawn node_modules\hermesvm\win64-bin\hermes ENOENT.
Part of the problem is that node_modules/hermesvm has been replaced with node_modules/hermes-engine starting from RN 0.61. #653 and #654 partially solve the issue, but do not account for the fact that the Hermes executable is hermes.exe and not hermes on Windows systems, meaning this:
always fails, which in turn makes AppCenter fall back on node_modules/hermesvm, which no longer exists.
Experiencing similar issue on OSX. From https://github.com/microsoft/appcenter-cli/issues/695
v10.16.2appcenter-cli: 2.3.0react-native-code-push: 5.7.0react-native: 0.61.4When attempting to upload a new react-native JS bundle to android, I get an Error: Failed to release a CodePush update.
The same command for our iOS bundle works fine.
npx appcenter codepush release-react -a <org>/<android-project> -d Staging -t "*" --disable-duplicate-release-error -k ./<key>.pem --debug
Using appcenter-cli version: 2.3.0
logFilter, request: {
"rawResponse": false,
"queryString": {},
"url": "https://api.appcenter.ms/v0.1/apps/<org>/<android-project>/deployments/Staging",
"method": "GET",
"headers": {
"Content-Type": "application/json; charset=utf-8",
"user-agent": "appcenterCli/2.3.0 NodeJS/v10.16.2 darwin/19.0.0",
"x-api-token": "REDACTED",
"internal-request-source": "cli",
"diagnostic-context": "REDACTED",
"cli-command-name": "codepush release-react"
},
"body": null
}
Response status code: 200
Body: {"name":"Staging","key":"REDACTED","latest_release":{"target_binary_range":"*","blob_url":"https://codepush.blob.core.windows.net/storagev2/REDACTED","is_disabled":false,"is_mandatory":false,"label":"REDACTED","package_hash":"REDACTED","released_by":"REDACTED","release_method":"Upload","rollout":100,"size":4565600,"upload_time":1573141714771,"diff_package_map":{"REDACTED":{"size":3352188,"url":"https://codepush.blob.core.windows.net/storagev2/REDACTED"},"REDACTED":{"size":3352188,"url":"https://codepush.blob.core.windows.net/storagev2/REDACTED"},"REDACTED":{"size":3352188,"url":"https://codepush.blob.core.windows.net/storagev2/REDACTED"},"REDACTED":{"size":3260286,"url":"https://codepush.blob.core.windows.net/storagev2/REDACTED"},"REDACTED":{"size":3260286,"url":"https://codepush.blob.core.windows.net/storagev2/REDACTED"}}}}
| Getting app info...logFilter, request: {
"rawResponse": false,
"queryString": {},
"url": "https://api.appcenter.ms/v0.1/apps/<org>/<android-project>",
"method": "GET",
"headers": {
"Content-Type": "application/json; charset=utf-8",
"user-agent": "appcenterCli/2.3.0 NodeJS/v10.16.2 darwin/19.0.0",
"x-api-token": "REDACTED",
"internal-request-source": "cli",
"diagnostic-context": "REDACTED",
"cli-command-name": "codepush release-react"
},
"body": null
}
| Getting app info...Response status code: 200
Body: {"id":"REDACTED","app_secret":"REDACTED","description":"","display_name":"<android-project>","name":"<android-project>","os":"Android","platform":"React-Native","origin":"appcenter","icon_url":null,"created_at":"2019-03-04T20:55:31.000Z","updated_at":"2019-03-05T04:46:49.000Z","release_type":null,"owner":{"id":"REDACTED","avatar_url":null,"display_name":"<org>","email":null,"name":"<org>","type":"org"},"azure_subscription":null,"member_permissions":["manager"]}
Running "react-native bundle" command:
node node_modules/react-native/local-cli/cli.js bundle --assets-dest /var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush --bundle-output /var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush/index.android.bundle --dev false --entry-file index.js --platform android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- react-native-code-push: https://microsoft.github.io/code-push
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
Loading dependency graph, done.
info Writing bundle output to:, /var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush/index.android.bundle
info Done writing bundle output
info Copying 67 asset files
info Done copying assets
Converting JS bundle to byte code via Hermes, running command:
node_modules/hermes-engine/osx-bin/hermes -emit-binary -out /var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush/index.android.bundle.hbc /var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush/index.android.bundle
/var/folders/jq/wx73dpvs2kl7337zynd6nxph0000gr/T/code-push20191011-75865-vke570.xccfe/CodePush/index.android.bundle:147:134: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
... (Bundle JS)
Releasing update contents to CodePush:
| Getting app info...logFilter, request: {
"rawResponse": false,
"queryString": {},
"url": "https://api.appcenter.ms/v0.1/apps/<org>/<android-project>",
"method": "GET",
"headers": {
"Content-Type": "application/json; charset=utf-8",
"user-agent": "appcenterCli/2.3.0 NodeJS/v10.16.2 darwin/19.0.0",
"x-api-token": "REDACTED",
"internal-request-source": "cli",
"diagnostic-context": "REDACTED",
"cli-command-name": "codepush release-react"
},
"body": null
}
| Getting app info...Response status code: 200
Body: {"id":"REDACTED","app_secret":"REDACTED","description":"","display_name":"<android-project>","name":"<android-project>","os":"Android","platform":"React-Native","origin":"appcenter","icon_url":null,"created_at":"2019-03-04T20:55:31.000Z","updated_at":"2019-03-05T04:46:49.000Z","release_type":null,"owner":{"id":"REDACTED","avatar_url":null,"display_name":"<org>","email":null,"name":"<org>","type":"org"},"azure_subscription":null,"member_permissions":["manager"]}
Error: Failed to release a CodePush update
It works for me with
Thanks @andrewkslv for the update. @tecaz @jacobcabantomski-ct were you able to resolve the issue with v2.3.1 of AppCenter or the issue still persists.
Still failing for me, looks like it got a bit further. I also upgraded to RN 0.61.5 so my config should match @andrewkslv 's
$ npx appcenter --version
appcenter version 2.3.1
...
Releasing update contents to CodePush:
| Getting app info...logFilter, request: {
"rawResponse": false,
"queryString": {},
"url": "https://api.appcenter.ms/v0.1/apps/<org>/<android-project>",
"method": "GET",
"headers": {
"Content-Type": "application/json; charset=utf-8",
"user-agent": "appcenterCli/2.3.1 NodeJS/v10.17.0 darwin/19.0.0",
"x-api-token": "REDACTED",
"internal-request-source": "cli",
"diagnostic-context": "REDACTED",
"cli-command-name": "codepush release-react"
},
"body": null
}
\ Getting app info...Response status code: 200
Body: {"id":"REDACTED","app_secret":"REDACTED","description":"","display_name":"<android-project>","name":"<android-project>","os":"Android","platform":"React-Native","origin":"appcenter","icon_url":null,"created_at":"2019-03-04T20:55:31.000Z","updated_at":"2019-03-05T04:46:49.000Z","release_type":null,"owner":{"id":"REDACTED","avatar_url":null,"display_name":"<org>","email":null,"name":"<org>","type":"org"},"azure_subscription":null,"member_permissions":["manager"]}
Generated a release signature and wrote it to /var/folders/sy/3w5bjcfn3c1byl0b9y0zzw680000gp/T/code-push2019112-12908-1efzd5y.bcwn/CodePush/.codepushrelease
Error: Failed to release a CodePush update.
Bug is still present in v2.3.1.
The issue should only affect Windows system; macOS and Linux systems shouldn't be affected since their hermes executable doesn't have an extension, which is what causes the build to fail on Windows (it's hermes.exe on Windows instead of just hermes).
@jacobcabantomski-ct's build seems to be failing on the upload step instead of the Hermes compilation step, I don't think these are caused by the same bug.
This is what the build process looks like on Windows systems:
Loading dependency graph, done.
info Writing bundle output to:, [...]\index.android.bundle
info Done writing bundle output
info Copying 31 asset files
info Done copying assets
Converting JS bundle to byte code via Hermes, running command:
node_modules\hermesvm\win64-bin\hermes -emit-binary -out [...]\index.android.bundle.hbc [...]\index.android.bundle -w
events.js:173
throw er; // Unhandled 'error' event
^
Error: spawn node_modules\hermesvm\win64-bin\hermes ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
at onErrorNT (internal/child_process.js:427:16)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
at onErrorNT (internal/child_process.js:427:16)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
l resolve this problem;
cd node_modules;
mkdir hermesvm;
cp -r hermes-engine/win64-bin hermesvm;
enjoy it;
Thanks to @Shywim for fixing this! We'll release the fix soon.
@anywherepilot this issue was grouped together with #695, and in that case the issue affects Mac OS, whereas the fix in #811 is specifically about Windows.
I believe that #695 is actually related to signing builds, as I'm experiencing the exact same behavior as the one reported by @jacobcabantomski-ct, but on Linux Edit: ~(and Mac OS)~, and only when I enable code signing (the -k parameter). The same command without the -k option works.
Edit: ~Should we open a different issue / reopen #695?~
This only happens on Linux, so I guess it's a different issue, will open a new one if that's ok
Hi @micheleb, sorry for the late reply. Always feel free to open issues! It's clear to me you took some time to consider whether the new issue would make sense. Since you believe it does, by all means open it :)
At First I clean my build directory and again build:
cd android & ./gradlew clean
./gradlew assembleStagingRelease
Then, When I use command to deploy code-push, with
appcenter codepush release-react -a <>/<> -m -d Release
I get this error:
node_modules/hermesvm/osx-bin/hermes -emit-binary -out /var/folders/3q/drghm7cs7gzc1c115xzbyg_00000gn/T/code-push2020524-82974-bg9ddv.b1c1l/CodePush/index.android.bundle.hbc /var/folders/3q/drghm7cs7gzc1c115xzbyg_00000gn/T/code-push2020524-82974-bg9ddv.b1c1l/CodePush/index.android.bundle -w
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn node_modules/hermesvm/osx-bin/hermes ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
"react-native": "0.63.0-rc.1",
"react-native-code-push": "^6.2.0",
"hermes-engine": "^0.5.0",
os: mac
@MahmonirB where is the hermes executable located on your machine?
in Hermes release 0.5.0: hermes.exe was renamed to hermesc.exe
can anyone make a PR for this change?
@thanhdatpd we renamed it in the latest release. I'm not sure it solves this issue, but even if not I'll close this now for inactivity.
Most helpful comment
l resolve this problem;
cd node_modules;
mkdir hermesvm;
cp -r hermes-engine/win64-bin hermesvm;
enjoy it;