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

Web inspector flashing on production/release build when starting the app #2071

Open
AdrianFahrbach opened this issue Feb 12, 2024 · 6 comments
Labels
bug Something isn't working Needs: Triage 🔍

Comments

@AdrianFahrbach
Copy link

AdrianFahrbach commented Feb 12, 2024

Environment

react-native -v: v0.72.10
npm ls react-native-macos: v0.72.16
node -v: v18.17.1
npm -v: v9.6.7
yarn --version: not using yarn
xcodebuild -version: Xcode 15.2 Build version 15C500b

Steps to reproduce the bug

  1. Follow the steps in the "Get Started with macOS" docs article, but use this command to install react native with the specific version that I am using: npx react-native@latest init <projectName> --template "react-native@^0.72.10"
  2. Build a release version of your app following the "Publishing to Apple App Store" of the React Native docs.
  3. Go to the folder where your Release app was saved (somewhere at /Users/<you>/Library/Developer/Xcode/DerivedData/<project-name>-<random-string>/Build/Products/Release/).
  4. Open the app in that folder. You will see the web inspector flashing.

Expected Behavior

The web inspector should be hidden in release/production mode.

Actual Behavior

The web inspector is flashing right before the app has loaded.

Reproducible Demo

Here is a video of the problem. I can also provide you with the test project that I was using but it's just the basic setup mentioned above.

screencap-2.mp4

Additional context

I didn't test this with other React Native version, expect 0.73 a while ago.
I also think that I didn't have this issue when I started with my project (react-native <0.72) I'm not at all sure on that though.

@AdrianFahrbach AdrianFahrbach added the bug Something isn't working label Feb 12, 2024
@Saadnajmi
Copy link
Collaborator

Heh.. that's new. Do you have one of these options enabled in Safari?
image

@Saadnajmi
Copy link
Collaborator

If you have access to your JSCRuntime in your app delegate, you may also be able to use the changes in this PR to disable debugging on ship: #1957

@AdrianFahrbach
Copy link
Author

Heh.. that's new. Do you have one of these options enabled in Safari?

Yes, this is it! 🤦‍♂️
Thank you so much for your fast response. Really appreciate it every time!

@Saadnajmi
Copy link
Collaborator

Heh.. that's new. Do you have one of these options enabled in Safari?

Yes, this is it! 🤦‍♂️ Thank you so much for your fast response. Really appreciate it every time!

Im still worried that a user launching a Ship React Native macOS app will see the flicker of the dev inspector every time, if they have this enabled. To confirm, you created a ship / release app with React Native macOS, have one of those options enabled, and see the flicker?

@Saadnajmi Saadnajmi reopened this Feb 13, 2024
@AdrianFahrbach
Copy link
Author

Heh.. that's new. Do you have one of these options enabled in Safari?

Yes, this is it! 🤦‍♂️ Thank you so much for your fast response. Really appreciate it every time!

Im still worried that a user launching a Ship React Native macOS app will see the flicker of the dev inspector every time, if they have this enabled. To confirm, you created a ship / release app with React Native macOS, have one of those options enabled, and see the flicker?

Yes, I had "Automatically Show Web Inspector for JSContexts" enabled.
Once I disabled this option, the web inspector didn't appear anymore. No rebuild required.
I don't remember enabling that option, but I'm a webdev, so it makes sense that I did.

@Saadnajmi
Copy link
Collaborator

@AdrianFahrbach I fear this is still a valid issue then, since for a split second, the JSContext shows up as debuggable instead of being off from the get go. I'll keep this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants