-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[π] Incorrect iOS Setup Guide β Unable To Connect To Metro Bundler #8246
Comments
I don't reproduce that. In react-native 0.76+ the template moved to Swift, so it is just a tiny bit different now, however in my build reproduction script from the previous release branch I sliced https://github.com/mikehardy/rnfbdemo/blob/04b101e880c4c79943d6ec12cebbc7f04c70c72e/make-demo.sh#L93 I run that thing a lot. It always worked? So I can't reproduce, and no one else has ever mentioned it? Additional confirmation for my assertion this is not reproducible and possible project-specific, the expo plugin we host (and which I assume tons of people use) also slices it in directly after AppDelegate and it has not resulted in any bug reports: react-native-firebase/packages/app/plugin/src/ios/appDelegate.ts Lines 18 to 24 in 9c6f607
I'm curious - If you can demonstrate a minimal + clean reproduction of this I could inspect more - but with those two heavy-usage counterfactuals linked above there's a high burden to demonstrating it (moving a header import location shouldn't really change much as far as I know - so not a huge change, but understanding the "why" of it is critical since this would be a pretty subtle thing and might point at a deeper problem) |
in react native 0.77,/ios/{projectName}/AppDelegate.mm file (or AppDelegate.m removed,so please correct ios setup guide for RN0.77 |
@mikehardy , thanks a lot for investigating this. I had very consistent problems with connecting the app to the metro bundler until I imported But if you cannot reproduce, it may be project specific, or may have had something to do with my cache. |
@zkteco-home you are right! It's Swift now. Just as fast as posting a comment, can click the Edit button on the top right of the docs page and follow through the super-fast github web UI for a PR to the docs where you saw it? This is the general process for any improvement you see. Please do not remove the references to the old AppDelegate.m or .mm, as people upgrade slowly. Just keep those as a reference to react-native before 0.77, thanks |
@julian-dotcom if I could reproduce I'd happily change that guidance - just need to understand the what+why first. My only guess is that somehow the same compiler symbol is defined twice in two separate libraries, and used incompatibly. if that's the case, knowing what that symbol could be is potentially interesting, as your solution may be allowing you to connect to Metro consistently now, but your whole app might just be working "by coincidence" so to speak. Not a stable place to be |
Documentation Feedback
The first step in the iOS setup guide led to an issue, where my app couldn't connect to the Metro Bundler.
https://rnfirebase.io/#configure-firebase-with-ios-credentials
The solution to this problem was the following:
#import <Firebase.h>
right after#import "AppDelegate.h"
at the top ofAppDelegate.mm
#import <React/RCTBundleURLProvider.h>
causes bundling to fail#import <Firebase.h>
after#import <React/RCTBundleURLProvider.h>
The text was updated successfully, but these errors were encountered: