Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

ionic serve - browser not refreshed on save #329

Closed
sveinl opened this issue Nov 8, 2016 · 26 comments
Closed

ionic serve - browser not refreshed on save #329

sveinl opened this issue Nov 8, 2016 · 26 comments

Comments

@sveinl
Copy link

sveinl commented Nov 8, 2016

Short description of the problem:

ionic serve -b doesnt refresh the browser after saving changes in editor. Have to save twice to make the changes updated in browser

What behavior are you expecting?

When saving the browser should refresh

Steps to reproduce:

  1. run ionic serve -b then open a browser for localhost:8100
  2. Edit some file in the project and save

Which @ionic/app-scripts version are you using?
0.0.40 and 0.0.41

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.39 <-- Reverted to 0.0.39 to make it work again
OS: Windows 10
Node Version: v6.7.0
@cleever
Copy link

cleever commented Nov 8, 2016

Same here. I had to switch back to 0.39 because of this.

@dallastjames
Copy link

+1 same issue using 0.0.41. Seems to be hit and miss. Some instances I have to quit out of serve mode and restart to get it to reload the files correctly.

@Iyashu5040
Copy link

Iyashu5040 commented Nov 9, 2016

Also experiencing this. Saving twice triggers a proper build/refresh.

Some more info:
The watch seems to trigger and the console outputs that a template update/transpile update has started. They finish successfully but the page in the browser does not refresh as it should. Even if you refresh the browser (F5) the source files have not been updated, so the page is still being served the files from the previous template/transpile update.

@cmaart
Copy link
Contributor

cmaart commented Nov 9, 2016

Can confirm,

@dylanvdmerwe
Copy link

Same issue experienced here. Never ending issues with this new build system!

@danbucholtz
Copy link
Contributor

Are you all developing on Windows? I have used app-scripts hundreds (thousands even) of times and I have never seen this - but I develop on a Mac.

Thanks,
Dan

@dylanvdmerwe
Copy link

I'm on a Mac, but my team uses Windows. Can everyone confirm if this is still an issue in the latest version?

@danbucholtz
Copy link
Contributor

danbucholtz commented Nov 11, 2016

I cannot recreate this on Windows 7 with Node 6.x - whatever the LTS version is. Just built out an app in the past 20 minutes and it worked flawlessly. I am thinking maybe it's a Windows 10 issue. I have never tested on Windows 10.

Thanks,
Dan

@sveinl
Copy link
Author

sveinl commented Nov 11, 2016

I just tried 0.0.43 and same issue.
Working fine in 0.0.39

I am on windows 10

I ran the serve with debug and attached the output if that can help you debug this issue.

ionic_serve_log.txt

@plmetz
Copy link

plmetz commented Nov 11, 2016

I see the same with Windows 10. Had to revert back to 0.0.39 which works fine. On @latest intermittently when saving multiple files the live reload triggers but changes in one file wouldn't reflect in the build.

@danbucholtz
Copy link
Contributor

When you see this occur, can you do me a favor and just refresh the page and see it the correct code is there? I am thinking this is a race condition on Windows where the "file write event" fires before the file is truly written. The bug would be in a library that we use but I have some ideas to work around it.

Thanks,
Dan

@sveinl
Copy link
Author

sveinl commented Nov 11, 2016

Just tested again with 0.0.43 - saved and the browser didnt reload.
Tried a manual reload of the browser but the app didnt update until i saved once more.

@danbucholtz
Copy link
Contributor

When this happens, are you saving more than one file at a time? Like a Save all functionality or something?

Thanks,
Dan

@sveinl
Copy link
Author

sveinl commented Nov 11, 2016

Only one file.
I also tried editing 2 files and then save-all. With the save-all test sometimes the browser updates - sometimes not. But usually wrong result - meaning the "old" file. Doesnt help manually refresh the browser.

@andborges
Copy link

andborges commented Nov 16, 2016

Same here guys, on Windows 10, saving one file or many files.
How can I revert to previous version?

Thanks.

@guillefd
Copy link

@andborges you can rollback the changes on your package.json and then run npm install
make sure this line says: "@ionic/app-scripts": "0.0.39",
If fails, you can try deleting the folders: ./tmp and /www and run again npm install (this folders are auto-generated)

@cmaart
Copy link
Contributor

cmaart commented Nov 28, 2016

Still no news concerning this issue?

For me the behavior @0.0.45 and .46 is like this:

  • Changes to HTML files make the browser go completely white and nothing happens. After a manual reload it seems to get the updated version so far
  • Changes to Typescript files seem to work

@Mokto
Copy link
Contributor

Mokto commented Nov 28, 2016

Working on Windows 7.

@danbucholtz
Copy link
Contributor

@cmaart,

Can you give me more info or a path to recreate the issue?

We released what we believed to be fixes for this issue. Are you all still experiencing it with 0.0.46?

Thanks,
Dan

@danbucholtz
Copy link
Contributor

This issue should be resolved. Please let me know if it's not and it's a major drain on productivity.

Thanks,
Dan

@joepadz
Copy link

joepadz commented May 31, 2017

ensure that all items are saved. Like for Visual Studio Code click the Save All button.

@ultrawebsites
Copy link

ultrawebsites commented Aug 9, 2017

Not sure if it's the same issue or a related issue. I have app-scripts v2.1.3 on Windows 10, and when I save a change to a HTML view file (*.html), the first time I save a transpile is NOT done; I have to save a second time for the transpile to be done and for the updates in to the HTML file to be visible in my browser.

Here are the echos from my command prompt for the first and second save of a .html file:
[11:05:39] build started ...
[11:05:39] template update started ...
[11:05:39] template update finished in 12 ms
[11:05:39] deeplinks update started ...
[11:05:39] deeplinks update finished in 176 ms
[11:05:39] build finished in 189 ms

[11:05:48] build started ...
[11:05:48] transpile started ...
[11:05:51] transpile finished in 3.32 s
[11:05:51] deeplinks update started ...
[11:05:51] deeplinks update finished in 94 ms
[11:05:51] webpack update started ...
[11:05:52] webpack update finished in 710 ms
[11:05:52] build finished in 4.12 s

It seems to be the transpile that makes the difference. Let me know if I should open a new bug. This happens for single file saves.

@tmk1991
Copy link

tmk1991 commented Sep 18, 2017

I have the exact same issue as @ultrawebsites.

"devDependencies": { "@ionic/app-scripts": "2.0.2", "@ionic/cli-plugin-cordova": "1.6.2", "@ionic/cli-plugin-ionic-angular": "1.4.1", "ionic": "3.6.0", "typescript": "2.3.4" },

@HenryKenya
Copy link

having the same issue.
Has this been fixed yet?

@jjjhanreyyy
Copy link

Issue still exist. Experienced it with windows 8 and windows 10.

@timsar2
Copy link

timsar2 commented Aug 6, 2018

today i was trying to config visual studio code with chrome for debug tools
after that i fall in this issue.
(Windows 7 & 10, ionic cli 4.0.3 lazyload)
page must save twice to show change on browser.
i also reset all change on vs code and chrome but issue still exist.
i had a warning too during start new ionic project

> npm i
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests