Ionic serve / ionic run not reflecting changes

Both ionic serve and ionic run are not reflecting any of my latest changes. ionic serve is showing them from a few hours ago, and ionic run is showing them from about an hour later. Since then, I’ve discarded all my changes, and created a new branch from the parent–yet it’s still showing those same versions from a few hours ago on the first branch. In short, there’s code showing up that I don’t have in any files in this, or any, branch. And no uncommitted changes.

I’m not sure what details would help figure out what’s happening here.

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.3.1 Build version 8E1000a

Somehow it’s not rebuilding your /src to /www :confused:

Try running npm run clean and then the commands you mentioned again.
If this doesn’t work try npm run build.

Still no change. Something else I’ve noticed is that this is what shows up in my console currently:

Static file server running @ http://localhost:8000/index.html
CTRL + C to shut down

200 /service-worker.js

Whereas it previously displayed a list of html, css, etc. requests when the page loaded.

Currently, I can make it work as expected by unregistering and removing all ServiceWorkers at
chrome://serviceworker-internals/
and
chrome://inspect/#service-workers

I solved this by cheking Update on reload, from Service Workers menu in Application tab. I don’t know if this is normal setting, but it’s how I made it reflect my changes again…

This post has some time but maybe someone else starts with this problem and it’s really annoying trying to update everything in your dependencies, when there’s nothing else to update, or remove node_modules.

How this happened? I really, but really don’t know, suddenly it just stopped reflecting changes. But this fixed it.

2 Likes

This issue is driving me absolutely nuts! I’m running my app in browser and on a phone using devApp. In both cases, changes to the code are (as far as I can tell) randomly reflected. sometimes a change works, and then after a save, the app goes back to acting as it did before the save. What the hell is going on? Seriously, I cannot see any pattern in the behavior that would point to a cause. I add a comment (!), save it, and it winds back to 20 minutes ago???!!!

not working this sol in my case . :frowning:(

In my case I am running ionic 5 and ionic serve was working till last night this morning ionic serve is not showing any file changes on the console and now reloading my app. also even if I refresh the browser the changes are not reflected. The only way to see the changes is to kill ionic serve process and start it again.

This is really weird. I tried another project with angular running ng serve and it works fine and it reloads changes upon saving. This is only with ionic.

1 Like

I faced with the same problem on Ubuntu 16.04 and angular CLI 1.0.0-beta.30

The problem was related to Inotify Watches Limit on Linux.
To solve to issue I increased the watches limit to 512K

sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p --system

After that, I restarted my IDE and after that, the change detection started to work.