Skip to content

Re-compile does not always trigger browser update #4453

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

Closed
Ionaru opened this issue Feb 6, 2017 · 26 comments · Fixed by #4542
Closed

Re-compile does not always trigger browser update #4453

Ionaru opened this issue Feb 6, 2017 · 26 comments · Fixed by #4542
Labels
needs: more info Reporter must clarify the issue

Comments

@Ionaru
Copy link

Ionaru commented Feb 6, 2017

OS?

Linux Kubuntu 16.10

Versions.

@angular/cli: 1.0.0-beta.30
node: 7.4.0
os: linux x64

Repro steps.

ng new newApp
cd newApp
ng serve
Edit app.component.ts (I changed 'app works!' to 'app works!!') and save.
This will trigger a re-compile.

The log given by the failure.

[WDS] App updated. Recompiling...
[WDS] App updated. Recompiling...
[WDS] Nothing changed.

Mention any other details that might be useful.

The hash between compile runs does not change.

I've seen an issue on this topic before, but it appears this is not a Windows-specific problem.

@biwin
Copy link

biwin commented Feb 6, 2017

this happens for minor changes.

@vaags
Copy link

vaags commented Feb 6, 2017

What kind of changes are considered to be "minor"?

@biwin
Copy link

biwin commented Feb 6, 2017

may be adding/removing a semi colon. who knows!

@audgirka
Copy link

audgirka commented Feb 6, 2017

I am also facing this same issue on ubuntu 16.04.

When I try to add / remove a piece of code like (console.log() or a tag from html)

@eklee
Copy link

eklee commented Feb 6, 2017

Also happens to me on Windows, for a new ng project, and an existing project that had been updated to 1.0.0-beta.30.

Changing a character in app.component.html triggers the browser update, but changing something in app.component.ts does not.

@klinki
Copy link

klinki commented Feb 6, 2017

I'm facing the same problem. I will investigate it little bit further, but from what I observed, I can tell changing .ts triggers recompilation, BUT browser is still seeing old data.

@rgurgul
Copy link

rgurgul commented Feb 6, 2017

I also have the same problem on Win 10.

@phil-cap
Copy link

phil-cap commented Feb 7, 2017

Same here with Win7, node v6.9.1, npm v3.10.8

@jsBrian
Copy link

jsBrian commented Feb 7, 2017

Same issue here: Win10 pro, Node.js v7.4.0, NPM v4.1.2.
When saving a .ts, the scripts compile, but:

  • the package sizes don't seem to change
  • the webapp doesn't refresh

For both my upgraded and new project.
Doesn't seem to matter if the change is small or big.

@jsBrian
Copy link

jsBrian commented Feb 7, 2017

Tested, and v1.0.0-beta.29 doesn't seem to have the same issue for me.

@jsBrian
Copy link

jsBrian commented Feb 7, 2017

I reinstalled beta 30, and I don't seem to have the issue anymore. :-\

@Brocco
Copy link
Contributor

Brocco commented Feb 7, 2017

@Ionaru can you please re-test and report back? make sure you run npm cache clean before you reinstall your dependencies. I was trying to reproduce this locally on a clean install of beta 30 and was not able to reproduce.

Thanks!

@Brocco Brocco added the needs: more info Reporter must clarify the issue label Feb 7, 2017
@jwuliger
Copy link

jwuliger commented Feb 7, 2017

FYI - To anyone who has not tried it yet. If you work directly from Master using npm link like shown in the README (at the bottom). It works, because the code for this has been fixed already. It can be a pain developing like that but I can always get through the NPM posted version error/bugs this way.

@MateEke
Copy link

MateEke commented Feb 7, 2017

We have the same issue on 3 Windows 10 machines with an existing project that had been updated to 1.0.0-beta.30 from 1.0.0-beta.26. All machines have Node 6.9.x.
One of the machines has a clean install of Windows, so no npm cache was present when the packages had been installed, it has 1.0.0-beta.30 from the beginning.

@Brocco
Copy link
Contributor

Brocco commented Feb 7, 2017

@MateEke are you able to share that repo?

@MateEke
Copy link

MateEke commented Feb 7, 2017

Sorry, but unfortunately not possible, as it's not an open source project.

@Brocco
Copy link
Contributor

Brocco commented Feb 7, 2017

That's cool... can you share your package.json and angular-cli.json?

@MateEke
Copy link

MateEke commented Feb 7, 2017

cli.zip

@ifynk
Copy link

ifynk commented Feb 8, 2017

I have some problem too. I just create new application with ng new. Then i started ng serve. Webpack compiled successfully. If i change template file or css then recompiled successful and live reload works. But if i change some in .ts files then live reloading not works and .ts files not compiled. Although webpack shown compiled successfully. If restart ng serve all changes apply successfully.

OS: Ubuntu 16.04 LTS
Node: v7.4.0
Npm: 4.0.5

{
"name": "slots",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angular/cli": "1.0.0-beta.30",
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "~2.0.3"
}
}

Log after .ts changing:

[WDS] App updated. Recompiling... [WDS] Nothing changed.

@Ionaru
Copy link
Author

Ionaru commented Feb 8, 2017

@Brocco

I can confirm this is still not working, I used a completely clean installation of @angular/cli.
What I did:
sudo npm -g remove @angular/cli
npm cache clean
sudo npm cache clean (just to be safe)
sudo npm -g install @angular/cli
ng new myNewApp (the myNewApp folder did not previously exist)
cd myNewApp
ng serve
Edited app.component (Two seperate edits, one with Kate and one with gedit)
But the hash in the ng serve terminal was still the same, and the website did not refresh.

I also tried doing the same steps using a direct clone and install of the Master branch as suggested by @jwuliger, no luck there either.

Edit: I just tested this on a clean install of Ubuntu 16.10 (On a VM), and the issue is still present.
@Brocco what were your steps trying to reproduce this?

@ocombe
Copy link
Contributor

ocombe commented Feb 8, 2017

I have the same problem on windows x64, node 6.9.5, and cli beta 30. I just started a new project so it is clean and it's probably not because of something in my code.

I see this in the chrome console:

[WDS] App updated. Recompiling...
[WDS] Nothing changed.

But in my shell it recompiled:

webpack: Compiling...
Hash: 6ba655a01c0532602548
Time: 476ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk    {1} main.bundle.js, main.bundle.map (main) 6.63 kB {3} [initial]
chunk    {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk    {3} vendor.bundle.js, vendor.bundle.map (vendor) 3.08 MB [initial]
chunk    {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
webpack: Compiled successfully.

@andyflatt
Copy link

I am seeing this too. I tried running off master as @jwuliger suggested and got a puzzling result.

At first it was not working, I thought I would try to trick it into doing a reload by purposely putting and error in the code then fixing it. To see if a failed build will force an update. This however did not work, and made all following builds fail, with the same error being shown even though it does not exist in the code.

I then quit the build and tried again. This time the reload started working. It now seems to be working.

Versions.
@angular/cli: 1.0.0-beta.30 and master
node: 7.4.0
os: Windows 7 x64

@LunaBawa
Copy link

It wouldnt be bad if i add myself to the list of those with a similar issue here... experienced it yesterday and till today i have done all i can think off and yet....still here standed.

image

@Ionaru
Copy link
Author

Ionaru commented Feb 12, 2017

@LunaBawa is that with the latest Angular CLI version (Beta 31)?

@RenaldasK
Copy link

I am experiencing this issue on @angular/cli: 1.3.0-rc.3

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.