Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hermes binary bundle deleted after upload #1885

Closed
rcstanciu opened this issue Jun 23, 2020 · 1 comment
Closed

Hermes binary bundle deleted after upload #1885

rcstanciu opened this issue Jun 23, 2020 · 1 comment
Assignees

Comments

@rcstanciu
Copy link

rcstanciu commented Jun 23, 2020

Steps to Reproduce

  1. Enable Hermes in Android native project
  2. Create and upload bundle using CodePush:
appcenter codepush release-react -a <app_name> \
-d Staging \ 
--target-binary-version=$npm_package_version \
-m \
--output-dir .

Expected Behavior

I specifically set --output-dir . as I want to upload the resulting bundle and sourcemap to Bugsnag. I expect, after running release-react command to find the binary bundle and the sourcemap in current directory.

Actual Behavior

CodePush creates a CodePush directory in current directory, where I can find the JS bundle and sourcemap (index.android.bundle and index.android.bundle.map), the binary sourcemap (index.android.bundle.hbc.map) but no binary bundle (which I expect to be index.android.bundle.hbc).

Screenshot 2020-06-23 at 18 13 39

I watched the directory, as CodePush was creating the bundles, and I saw that the file gets created but disappears immediately (moved/deleted?), possibly when starting the upload. These are the logs:

Running "react-native bundle" command:

node node_modules/.bin/react-native bundle --assets-dest CodePush --bundle-output CodePush/index.android.bundle --dev false --entry-file index.js --platform android --sourcemap-output CodePush/index.android.bundle.map
Welcome to React Native!
                Learn once, write anywhere

info Writing bundle output to:, CodePush/index.android.bundle
info Writing sourcemap output to:, CodePush/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 196 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 CodePush/index.android.bundle.hbc CodePush/index.android.bundle -output-source-map -w

Releasing update contents to CodePush:

Successfully released an update containing the "CodePush" directory to the "Staging" deployment of the "MyApp-Android" app.

Environment

  • react-native-code-push version: 6.2.0
  • react-native version: 0.62.2
  • appcenter-cli: 2.6.0
@rcstanciu rcstanciu changed the title Hermes binary build deleted after upload Hermes binary bundle deleted after upload Jun 23, 2020
@alexandergoncharov-zz alexandergoncharov-zz self-assigned this Jun 25, 2020
@rcstanciu
Copy link
Author

I've checked the source code of appcenter-cli and I found that this is the expected behavior: the HBC build overrides the JS build. Here is the actual code reference:

https://github.com/microsoft/appcenter-cli/blob/2777a4c682f16ae9422f5b05ea0d945e4061a5f8/src/commands/codepush/lib/react-native-utils.ts#L384

I will close this now as this is not an issue anymore.

Still, this build/sourcemap cannot be used with Bugsnag because, as I've been explained here bugsnag/bugsnag-react-native#463 (comment), the sourcemap is rendered in binary format when building through CodePush.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants