react-native
react-native copied to clipboard
[iOS] Seeing Hermes Inspecter Threads in release app
Description
We see Hermes Inspector threads to be present in release/production version of the app.
Ideally anything related to dev tooling should not be present in release/production version of the app.
React Native Version
0.70.7
Output of npx react-native info
System: OS: macOS 13.5.2 CPU: (10) arm64 Apple M1 Pro Memory: 315.55 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node Yarn: 1.18.0 - /opt/homebrew/bin/yarn npm: 8.15.1 - ~/Documents/my-app/node_modules/.bin/npm Watchman: 2023.08.28.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/jayshah/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.10121639 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 17.0.7 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.7 => 0.70.7 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Just run a release version of the app.
Setup Sentry or any other error analytics tool.
See the threads present in the crash report.
We should not have "hermes inspector connection" and related threads.
Snack, screenshot, or link to a repository
:warning: | Unsupported Version of React Native |
---|---|
:information_source: | It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support. |
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
Can you provide a stronger evidence that this is actually happening in any release version of React Native and is not just a misconfiguration on your end? Specifically, I can't set up Sentry to reproduce this
It is a release version of the app. I will reproduce it in a sample react native app which is packaged for release to the stores(https://reactnative.dev/docs/publishing-to-app-store#3-build-app-for-release). Also will take a look at tooling to inspect/enumerate threads in the running app.
Unsubscribe
William Pope Jr
On Wed, Sep 20, 2023, 6:47 AM jay shah @.***> wrote:
Description
We see Hermes Inspector threads to be present in release/production version of the app.
Ideally anything related to dev tooling should not be present in release/production version of the app. React Native Version
0.68.2 Output of npx react-native info
System: OS: macOS 13.5.2 CPU: (10) arm64 Apple M1 Pro Memory: 315.55 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node Yarn: 1.18.0 - /opt/homebrew/bin/yarn npm: 8.15.1 - ~/Documents/my-app/node_modules/.bin/npm Watchman: 2023.08.28.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/jayshah/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.10121639 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 17.0.7 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found Steps to reproduce
Just run a release version of the app.
Setup Sentry or any other error analytics tool.
See the threads present in the crash report.
We should not have "hermes inspector connection" and related threads. Snack, screenshot, or link to a repository [image: Screenshot 2023-09-20 at 4 12 39 PM] https://user-images.githubusercontent.com/659202/269257017-0f0fe2c1-1f55-4de4-9c79-8ed297ab2045.png
— Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/39556, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNSC3C4CQMX37LKVSIFA5TX3LCVNANCNFSM6AAAAAA47WOECY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Same for RN 0.72.5
hermes-inspector
, hermes-chrome-inspector-conn
in production build
They appeared after updating from version RN 0.70.6
Workaround for RN 0.72.5
export PRODUCTION=1
export NO_FLIPPER=1
Added before bundle exec pod install
, for prod build environment, ios/.xcode.env
file, Fastlane, everywhere...
@cortinico should these flags mentioned be added in the docs after appropriate review of core team members? It would be a huge win for existing and new apps.
@cortinico should these flags mentioned be added in the docs after appropriate review of core team members? It would be a huge win for existing and new apps.
Nope we should not document this as it's a workaround. @cipolleschi can help further in triaging this problem, but normally you should not need to set those variables in your environment before the build.
Actually, it is expected. To build your app for production in 0.72, you have to use those flags to build the app. That's not a workaround but the proper way to do it in 0.72 and lower. We had to introduce those flags as, before, Release builds will not build due to an issue with flipper missing some symbols in Release mode.
@jayshah123 It is a good idea to add a section of the docs for 0.72 and lower explaining this. Would you mind open a PR on the website? :D
Actually, it is expected. To build your app for production in 0.72, you have to use those flags to build the app. That's not a workaround but the proper way to do it in 0.72 and lower. We had to introduce those flags as, before, Release builds will not build due to an issue with flipper missing some symbols in Release mode.
@jayshah123 It is a good idea to add a section of the docs for 0.72 and lower explaining this. Would you mind open a PR on the website? :D
What is the earliest version of RN where these flags need to be set during build? I think the flags are needed all the way till latest version.
So far we are maintaining 0.70 -> 0.73.rc.
From 0.70 to 0.72: they need both flags.
For 0.73, you'll only need export NO_FLIPPER=1
, as we fixed the reason why we needed PRODUCTION=1
.
From 0.74 onward, you'll need no flag at all.
😄
I have added both flags: but to no avail, I am on 0.70.13.
Could you point me to files, commits that start these threads so I can understand this better?
Everything goes back to this discussion of 1 year and a half ago: https://github.com/facebook/react-native/issues/33764
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.