Ionic serve is not building my project when saved

#1

Hello everybody,

I just updated the CLI and suddenly, when I save some changes on my project, it doesn’t build it with the new changes and refresh my browser as it used to, even if I refresh the page manually. I have to close the ionic serve and reopen it in order to work.

This is my package.json:


{
  "name": "Apalacam",
  "version": "0.0.1",
  "author": "RaulGM3",
  "homepage": "https://apaladar.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/core": "3.12.1",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.5.0",
    "ionicons": "3.0.0",
    "rxjs": "5.4.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "2.0.1",
    "@ionic/cli-plugin-ionic-angular": "1.3.2",
    "typescript": "2.3.4"
  },
  "description": "An Ionic project"
}

I’m breaking my head for this, any ideas about this?

#2

Post your ionic info output please.

Does it really not build, or does it build (new lines in the ionic serve console) and only the changes are not picked up? What exactly are you changing in your project?

#3

Here is my ionic info:

global packages:

    @ionic/cli-utils : 1.5.0
    Ionic CLI        : 3.5.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.6.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.9.1 
    ios-sim    : not installed
    npm        : 3.10.3

When I enter ionic serve everything works ok, the entire project is compiled and there’s no problem at all.

When the server is up and I change some lines of code, the changes don’t get reflected on the browser. It’s like I didn’t make any changes.

Thanks for the reply.

#4

Ok, but do get new lines added in the console and does the browser show the black “building” bar and then reload - and just then show the same stuff as before?

What exactly are you changing when you see this behavior?[quote=“RaulGM, post:3, topic:97971”]
@ionic/app-scripts : 1.3.7
[/quote]
This is outdated and should be updated to 1.3.12 or even 2.x (read the changelog for necessary changes in index.html).

#5

Is the console window the Terminal? In that case, nothing happens.

And I just tried to change a .ts file and nothing happend.

#6

Ok, so it doesn’t even observe that you changed the file.
What happens if you press the spacebar in the console window?
What happens if you change a .ts file instead of a template?

#7

Is the console window the Terminal? In that case, nothing happens.

And I just tried to change a .ts file and nothing happend.

I’m comparing other projects file by file with this new one, everything seems normal so far.

#8

Yes. On windows the build process sometimes just hangs and only continues when there is input. No idea why and also not reproducible.[quote=“RaulGM, post:7, topic:97971”]
I’m comparing other projects file by file with this new one, everything seems normal so far.
[/quote]

Sorry, I am out of ideas here.

#9

What I is on my mind is that there is a command in tsconfig or something like that that enables or disables the build when the project is saved. I find that, in tsconfig there is this line of code that sais "compileOnSave": false, but when compared with other projects that works perfectly good, the line is exactly the same.

#10

today i have same issue.
i’m using ionic 4.0.3 with lazyload
page will not change after first save
must save page twice

also i got this warning when create new project

ionic start project2 tabs
> npm i
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Br
owserslist >3.0 config used in other tools.