Have to restart server to see changes for iOS locally

I’ve been fighting this issue for well over 2 weeks now.

Basically, I have a Expo app created with the npx create-expo-app --template blank-typescript command. When I run it using npm run ios, or npx expo start --ios, all works fine.

It’s when I update some of my files where can’t seem to see any of the changes in the iOS simulator. Not even if I trigger the developer menu and hit reload do I see my changes. I have to close the simulator, quit my server, and restart to make it show.

I’ve tried running npm run web and that works perfectly fine. I’ve been diving deep into trying to see if it’s a issue with Watchman, but I feel like I’ve tried every single suggested solution out there.

Does anyone have the slightest hunch of what could be going here?

Help would be highly appreciated, and I will of course provide more details when necessary. I’m so eager to build this app right now, so this really bums me out to be honest :confused:

Do you see any output on the terminal after you save an update to a file, e.g., a message like iOS bundling complete? I’m not sure what it would be, but, if you don’t, that would indicate some kind of watchman issue. If watchman doesn’t pick up the change, the code isn’t rebuilt, and refresh isn’t triggered (nor would manually refreshing change anything).

One good thing to try just in case you haven’t already in the dev menu would be to make sure the debugger is turned off, just to eliminate entities to troubleshoot.

Yeah I’m not getting anything in the terminal on save. Don’t have debugging enabled either. If I run watchman watch-list, it does show the app through…

{
    "version": "HEAD-039ebd4",
    "roots": [
        "/Users/demando/Desktop/test-app-2"
    ]
}

Hmm, I think it might have been something with how I ordered my environment variables in my .zshrc. Also had some duplicates. I cleaned those out and moved the NVM variables to the bottom of the file, and now it seems to work. I also interestingly noticed that I get the actual QR code in the terminal, which I didn’t get previously…

1 Like

If you are experiencing issues with not seeing changes in the iOS simulator when running your Expo app, despite triggering reload or restarting the server, there are a few potential solutions you can try.

Firstly, ensure that you have the latest version of Expo CLI installed. You can do this by running npm install -g expo-cli to update or reinstall Expo globally.

Next, try resetting the cache by running expo start -c or rm -rf ~/.expo to clear any cached data that may be causing the issue.

If that doesn’t resolve the problem, check your file-watching configuration. Make sure that the file extensions you are modifying are included in the watch configuration, typically specified in the app.json or metro.config.js file.

You can also try running the Expo app with the --no-dev flag to see if it’s related to the development mode. For example, use npm run ios --no-dev or npx expo start --no-dev --ios to run the app without development optimizations.

If none of these solutions work, it’s possible that there might be a bug or compatibility issue specific to your project or development environment. In such cases, reaching out to the Expo community or their official support channels for further assistance would be beneficial. They can provide more specific guidance based on your project details and help troubleshoot the issue effectively.