Skip to content
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

Build is not kicking off in a browser on save #4338

Closed
kuncevic opened this issue Feb 2, 2017 · 81 comments · Fixed by #4384
Closed

Build is not kicking off in a browser on save #4338

kuncevic opened this issue Feb 2, 2017 · 81 comments · Fixed by #4384
Labels
P0 Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds type: bug/fix

Comments

@kuncevic
Copy link

kuncevic commented Feb 2, 2017

OS

Windows 10.

Versions.

angular-cli: 1.0.0-beta.28.3
node: 6.9.2
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/flex-layout: 2.0.0-beta.4
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5

Repro steps.

Migrate from beta.24 to beta.28.3
Modify any file
Click save
Chrome dev console saying:

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

The new build is not kicking off

So had to stop and reastart ng serve manually

@BondiGeek
Copy link

Same issue here.

@kuncevic kuncevic changed the title Build is not kicking off on save Build is not kicking off in a browser on save Feb 2, 2017
@idc1407
Copy link

idc1407 commented Feb 2, 2017

same issue here

@jwuliger
Copy link

jwuliger commented Feb 2, 2017

Hello. I am having the same problem. Every change I make to ANY file causes me to end the command and do ng serve just to see the changes.

@ram3shyadav
Copy link

ram3shyadav commented Feb 2, 2017

Same issue. Recompile is not working properly.

And you are showing that next release will be production release.

@ghost
Copy link

ghost commented Feb 2, 2017

Hello, I have the same issue but ONLY with pipes, version beta 26

@abeagley
Copy link

abeagley commented Feb 2, 2017

Same issue here on Win 10

@danielsogl
Copy link
Contributor

Beta 28 is broken af...

@WouterSpaak
Copy link

This issue seems to affect new .ts files or changes in any .ts files as well. Template changes in .html files update, but underlying script files do not.

@leonelgoncalves
Copy link

im having this same issue in win10

@dev
Copy link

dev commented Feb 2, 2017

Same issue here...

@Meligy
Copy link
Contributor

Meligy commented Feb 2, 2017

Anybody tried beta 29?

@Meligy
Copy link
Contributor

Meligy commented Feb 2, 2017

Note that beta 29 comes with a new package name @angular/cli instead of angular-cli.

@PierreDuc
Copy link

@angular/cli has the same problem. Changes are not detected. Especially difficult when a full rebuild takes more than 30 seconds

@PierreDuc
Copy link

Anybody else having a hard time reverting back to beta 26? I've gotten so far as to remove all node_modules global, local and cache and reverting to what I know was a working state of my project, but still no changes are detected when I run ng serve.

@Meligy
Copy link
Contributor

Meligy commented Feb 2, 2017

hmm..

On Mac OS latest and NPM 6.x latest, I was able to get a new beta.29 project to detect changes to:

Could this be OS related or upgrade related?

Any concrete steps to reproduce on a new project?

@dev
Copy link

dev commented Feb 2, 2017

npm install --save @ngtools/[email protected]
seems to have fixed it for me.
thanks to @beeman for his solution in #4329.

@Meligy
Copy link
Contributor

Meligy commented Feb 2, 2017

That explains why it works for me. The version I get on a new project is @ngtools/[email protected].

@intellix
Copy link
Contributor

intellix commented Feb 2, 2017

Yep. There was an issue previously with webpack 1.2.5 which was fixed in 1.2.6 a couple of hours ago. A new angular-cli wasn't released, just a new version of @ngtools/webpack, so make sure you've got that guys

@PierreDuc
Copy link

Well, that explains why reverting to an old version doesn't work. Older cli versions will still download the new webpack version

@aprades
Copy link

aprades commented Feb 2, 2017

It still doesn't work for me. Started new project, and still same issue.

angular-cli: 1.0.0-beta.28.3
node: 6.9.5
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5
@ngtools/webpack: 1.2.6

@dev
Copy link

dev commented Feb 2, 2017

@aprades cd to your project and run npm install --save @ngtools/[email protected] in that directory

@aprades
Copy link

aprades commented Feb 2, 2017

Ok, it doesn't work with @ngtools/[email protected]

With @ngtools/[email protected] it works fine.

@dev
Copy link

dev commented Feb 2, 2017

Great @aprades!

@niklas-dahl
Copy link
Contributor

I freshly installed angular-cli npm uninstall -g angular-cli && npm i -g angular-cli and im getting the following warnings:

npm WARN optional Skipping failed optional dependency /angular-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
npm WARN @angular/[email protected] requires a peer of zone.js@^0.7.2 but none was installed.

Trying ng --version gives me a lot of Cannot find module 'reflect-metadata' Errors.
Is this related to the restructuring of the cli packages?

Previously it worked just fine.

@RicardoVaranda
Copy link
Contributor

@niklas-dahl The new npm name for the project is @angular/cli try:

npm install -g @angular/cli

@lukichev
Copy link

lukichev commented Feb 2, 2017

Thanks, @Legit . Installing @ngtools/[email protected] resolved my issue.

@raducostea
Copy link

I can see an about 2s improvement. I get a 2-3 seconds build time on save. Previously i was getting 4-5 seconds before.

@MickL
Copy link

MickL commented Feb 6, 2017

When will there be a release? Im waiting for this every day :)

@raducostea
Copy link

This was already fixed for me in the latest @angular/cli

@MickL
Copy link

MickL commented Feb 6, 2017

In beta 30? I didn't see it in the changelog tho.

@raducostea
Copy link

9fcf10a

I removed node_modules, i've ran npm install and 9fcf10a is present in the build already.

@MickL
Copy link

MickL commented Feb 6, 2017

In master, but not in beta 30 :/

@JiriBalcar
Copy link

JiriBalcar commented Feb 6, 2017 via email

@abdo0
Copy link

abdo0 commented Feb 7, 2017

Thanks @Legit for solving my issue

@slubowsky
Copy link

slubowsky commented Feb 7, 2017

Seems to be fixed for dev mode but still broken if use ng --aot --prod (didn't try just one).

Using a number that I keep incrementing to see what gets displayed it looks like somehow its serving up what was two compilations behind. i.e. starting at 0 at incrementing by 1, I see 1 when last saved and compiled change was 3, and 2 when last change was 4, etc..

@ulymor
Copy link

ulymor commented Feb 8, 2017

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

The problem was related with 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 (WebStorm in my case) and after that the change detection started to work.

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
…iles (angular#4384)

Fix WebpackCompilerHost's cache invalidation behavior on Windows
systems. Previously, no call to _resolve was made, causing paths with
backslashes not to match the file cache.

Fixes angular#4422
Fixes angular#4345
Fixes angular#4338
@alaindeurveilher
Copy link

@ulymor you'd probably be interested in this comment #2389 (comment) :-), as apparently modifying the inotify settings as so would use a large amount of RAM for nothing.

@lihaibh
Copy link

lihaibh commented Mar 4, 2017

installing "@ngtools/webpack": "1.2.4" does work but the compilation is extreamly slow, why?

@crosma
Copy link

crosma commented Apr 2, 2017

I'm still experiencing this issue. I'm building an a freshly updated Rasberry Pi 3 Model B.

@angular/cli: 1.0.0
node: 7.8.0
os: linux arm
@angular/cli: 1.0.0
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/compiler-cli: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@ngtools/webpack: 1.3.0

It always catches that a file changes and rebuilds and sometimes works but eventually stops reflecting changes browser side. Once it stops working, it requires restarting ng serve to fix it.

@sandangel
Copy link

same issue here:
OS: Arch Linux
@angular/cli: 1.0.0

{
  "name": "client",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0",
    "@angular/compiler-cli": "^4.0.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.2.0"
  }
}

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
…iles (angular#4384)

Fix WebpackCompilerHost's cache invalidation behavior on Windows
systems. Previously, no call to _resolve was made, causing paths with
backslashes not to match the file cache.

Fixes angular#4422
Fixes angular#4345
Fixes angular#4338
@themroc5
Copy link

themroc5 commented Apr 20, 2017

I had the same issue but got it working!

My setup: A virtual machine running Linux with shared folders to Windows, coding in PhpStorm.
My solution: In PhpStorm disabling the option Use "safe write" under Appearance / System Settings

@aaronhoffman
Copy link

Thought I should add this here. This is an open PR linked to by other issues similar to this one. It may contain a resolution for others still having this issue. #4009

@abalad
Copy link

abalad commented May 26, 2017

@themroc5 Thank you. It was well this problem that was also happening through WebStorm, now it worked.

@Bsujeet
Copy link

Bsujeet commented Jun 15, 2017

hey i am new to angular just created new project as told in quick start.
But ng serve is not recompiling.
i tried all the things that are mentioned above.
but still not working,
My current version of @angular/cli is 1.1.1 and webpack is 1.4.

when i install webpack 1.2.4 it gives error while compiling.

@nitinshk1111
Copy link

I am also facing the same issue. ng serve is not getting reloaded when changes made in a particular directory Model. Apart from those Model classes it is detecting the changes..
I ran the command ng --version and got this result..

@angular/cli: 1.3.2
node: 6.11.2
os: win32 x64
@angular/animations: 4.4.3
@angular/cdk: 2.0.0-beta.11
@angular/common: 4.4.3
@angular/compiler: 4.4.3
@angular/core: 4.4.3
@angular/forms: 4.4.3
@angular/http: 4.4.3
@angular/material: 2.0.0-beta.11
@angular/platform-browser: 4.4.3
@angular/platform-browser-dynamic: 4.4.3
@angular/router: 4.4.3
@angular/cli: 1.3.2
@angular/compiler-cli: 4.4.3
@angular/language-service: 4.4.3

Please help me to fix this issue..

@mhyeganeh
Copy link

@themroc5 Thank you very much! After two days spending on this problem, finally solved and I had no idea it was all about phpStrom !

@web-dave
Copy link

web-dave commented Jan 9, 2018

@mhyeganeh I find this issue very often in my workshops.

@chapultepec
Copy link

sudo ng serve works for me!

@clydin
Copy link
Member

clydin commented Sep 13, 2018

@chapultepec Please do not repeatedly cross-post the same message.

Also, advocating running a command as root as a general solution opens up the user to potential security implications. sudo should only be used when root permissions are absolutely required.

@chapultepec
Copy link

@clydin sorry i was trying to help because the issue is repeated.
So if using sudo is not the best solution wich could be the solution?

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P0 Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.