-
Notifications
You must be signed in to change notification settings - Fork 626
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
Metro server restart is needed to see code changes in demo project in iOS simulator #982
Comments
Passing this over to the Metro team |
any updates for the solution, facing the same issue |
anyone got the solution? |
Thanks for the reports all - if anyone is still seeing this issue, could you start Metro with That should let us know where the change is being missed and would be a big help narrowing the problem down. Thanks! |
It is still saying same issue. No apps connected. |
@robhogan Thanks for the reply. I made a new video with your instructions: live-reload-not-working-low.mp4I allowed myself to do some other tests. I ran
So I assume that points to an issue in the way Metro communicates/interacts with watchman? |
Hi @JulienFremy - thanks for that, super helpful. The absence of a "Using watcher:" log there is interesting and suggests That comes from here - as you see in the absence of an explicit
You could try If not, maybe there's either an explicit |
@robhogan Thanks for your investigation! After removing this variable, running
Running
Thanks again a ton, this issue was very misleading for me, and I would never have found without your help! |
@robhogan I am not able to connect metro to my ios emulator. It says no app’s available on react native version 0.72.0 Please help me i am stuck on it. |
@robhogan, thanks, CI was the problem |
Here the same problem. The just thing that works was run the My configuration:
|
Still facing the issue : I only have it on simulators tho, physical iPhone works fine. i'm using iPhone 15 IOS 17.0 and it seems that this all started since macOS update to sonoma
Macbook intel 2019: Sonoma 14.1.1 |
Hello everyone, I'm like @ghostgarrix concerning the version, except I'm under RN 0.73.2. I'm a bit confused here. Someone have any solution here ? |
Hi @thib-info, are you having the same experience as @ghostgarrix that a physical device works fine, but only simulators fail to fast refresh? If that's the case it points to a connection issue between the simulator and the dev server, rather than an issue with Metro or your Metro config. This isn't a widespread problem as far as I've seen, and it doesn't reproduce for me. One thing to get out of the way - make sure Fast Refresh isn't disabled on your client in the dev menu (Cmd+D). Assuming it's enabled, check that other messages are getting through on the socket connection - if you console.log in your app, do you see the log in Metro? |
Hello back @robhogan, thanks for your help. I've tested on my simulator and on my real device also. Neither of them manage to refresh as expected. It's really weird because when I'm reloading the app straight from the metro menu, with the "build app on ios", it builds the app, runs it on the simulator but don't manage to stay attached to it. When I'm trying to reload the app it says that any metro application is being found .... |
I'm also faced with the same problem, I just set up react native on a MacBook Air M1 running Sonoma 14.2.1, I have a project that I cloned down which was working absolutely fine on my main computer running Ventura 13.6.3, but now no changes to my code aren't registering in any of my simulators, even when I shut down metro and re-start it. Forgive my coding naiveté since I have only been doing it a year, but I am not sure I understand what the seeming fix was... |
So I seemed to get it working with a little help from chat gpt, and looking at some error messages It seems like you're encountering warnings related to Watchman, specifically regarding the recrawling of watches. The warnings suggest that Watchman has had to recrawl your project multiple times, and it provides a suggested resolution. To address this issue, you can follow the provided instructions to clear the warning: watchman watch-del '/Users/myname/Documents/MYPROJECT/myappRoot' ; watchman watch-project '/Users/myname/Documents/MYPROJECT/myappRoot' This command is essentially telling Watchman to stop watching the specified directory (watch-del) and then re-add it as a watched project (watch-project). This process can help in resolving issues related to watchman's tracking and monitoring of changes within your project. After running this command, try re-running your Yarn command or the task you were attempting. If the issue persists, you may want to review the Watchman documentation or seek assistance from the Watchman community for further troubleshooting. |
Hello. Just one "solution" solves this problem for me. I started the server with sudo command and everything works fine. On root project folder run: |
Yeah, I did try that and as I recall that is what flagged the watchman crawl error. Do you run 'sudo yarn start' every time you want to open an emulator now, or did you just do it as a one off and it fixed the problem globally? It seems to have fixed globally for me, but it is hard to pinpoint exactly what I did that worked. I also used 'unset CI' which perhaps did something? Is this a Sonoma specific problem? |
@Roboto-Automo just in one project I need to run using sudo, other projects or a new project works fine without sudo command. |
I'm now under RN 0.73 and still facing the issue. Does anyone have any idea on how to bypass this issue ? |
Mine works fine now after implementing the commands from earlier in the thread, if none of these are working for you then I am sorry, I remember it being quite a head ache though. When it worked it was just like some magic. |
Description
Hello and thanks for this project.
I'm new in react-native so maybe I miss something obvious, but I failed to find a solution after a decent research effort, so here goes.
I'm trying to run the demo project on an iOS simulator. The project in itself runs fine, I'm running
npx react-native start
in a shell, andnpx react-native run-ios
in an another shell.But I can't get to have a local modification of the
App.tsx
reflected in the app, unless I stop and start again metro (stop and start againnpx react-native start
).This is not the way it's supposed to work I believe.
If I understood things correctly, normally I should be able to at least see changes when I reload manually the app (by pressing Cmd+R in the simulator or pressing r in the metro server app). When I do so, I see that there is a reload occurring but my changes are not reflected (I made sure that my changes were saved in the IDE).
The other option, (Hot Reload or Fast Refresh, I believe they are the same thing), is not working as well at all.
I can provide additional info if needed.
Thanks!
React Native Version
0.71.8
Output of
npx react-native info
System:
OS: macOS 13.2.1
CPU: (10) arm64 Apple M1 Max
Memory: 8.43 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.1.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.6.4 - /opt/homebrew/bin/npm
Watchman: 2023.05.08.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 19.0.2 - /opt/homebrew/opt/openjdk/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Follow these steps here, and choose:
ReactNative CLI Quickstart
Development OS: macOS
Target OS: iOS
Just follow the main setup with no particular options for the tools.
At the end, try to edit code and reload app: update not reflected.
Snack, code example, screenshot, or link to a repository
reload-does-not-update-app.mp4
The text was updated successfully, but these errors were encountered: