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

rebuild with ng serve is not reliable #5404

Closed
manuel-mauky opened this issue Mar 13, 2017 · 30 comments · Fixed by #5489
Closed

rebuild with ng serve is not reliable #5404

manuel-mauky opened this issue Mar 13, 2017 · 30 comments · Fixed by #5489
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@manuel-mauky
Copy link

I'm using ng serve to get instant feedback while I'm developing but in some (unknown) situations the rebuilding isn't reliable. Sometimes I'm getting compile errors that I've already fixed. If I restart ng serve then the errors don't show up anymore.
This worsens developer productivity a lot because I spend time to find an error in my code that doesn't exist anymore until I remember to restart the build command.

OS?

Windows 8

Versions.

$ ng --version
@angular/cli: 1.0.0-rc.1
node: 7.1.0
os: win32 x64

Repro steps.

App was created using the CLI. I'm not able to reliable reproduce the problem. It sometimes happens and sometimes not.
However, these are the steps I'm doing:

  1. ng serve
  2. write some code and rebuilding works fine
  3. write an error in the code that produces a compile error
  4. fix the code
  5. The code is rebuild as expected but the compile error still shows up.
  6. kill ng serve and restart it
  7. The code compiles just fine.

The log given by the failure.

No specific error message.

Mention any other details that might be useful.

I've used version 1.0.0-beta.24 for a long time without such problems. Only after I updated to 1.0.0-rc.1 the problem started to occur.

@filipesilva filipesilva added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix labels Mar 13, 2017
@raularagonez
Copy link

I'm also having issues with 1.0.0-rc.1, I want to see the diffs but I don't see a release for it https://github.com/angular/angular-cli/releases. 1.0.0-rc.0 is works fine.

@BobBDE
Copy link

BobBDE commented Mar 13, 2017

Hi,

I have the same problem since 1.0.0-rc.1.
But for me it appear (amost everytime) when I create/modify or delete an interface.

For exemple if I create a new interface (after the ng serve being launch), I have an error on the compilation, that says that the interface does not exsit. To fixe it I need to restart the ng serve.

@rainstormza
Copy link

beta 32.3
happened to me too
when I try import library pdfmake

sometime error appear after I save the same code again , don't know why

@JFrankfurt
Copy link

Happens to me in beta-26

@AntiCZ
Copy link

AntiCZ commented Mar 14, 2017

I have same problem with 1.0.0-rc.0

@vaags
Copy link

vaags commented Mar 14, 2017

I can confirm that changes in interfaces are not picked up automatically in 1.0.0-rc.0, meaning I have to re-run "ng serve" manually whenever I change an interface.

@icepeng
Copy link

icepeng commented Mar 15, 2017

Sometimes, when I save interface file on editor, compile errors are gone. But after saving other files, error occurs again.

@geoffgb
Copy link

geoffgb commented Mar 15, 2017

Having the same or similar issue as the op. Changes to html and css files seem to get detected and update just fine but changes to classes, components, or interfaces get detected but the the in memory build doesn't seem to get updated from time to time until I fully restart ng serve.

$ ng --version
@angular/cli: 1.0.0-rc.1
node: 7.1.0
os: win32 x64

@hansl hansl added this to the 1.0 Final Blocking milestone Mar 16, 2017
hansl added a commit to hansl/angular-cli that referenced this issue Mar 17, 2017
Before there was a bug that the file wasnt forced to rediagnose.

If the file changed, we wont diagnose it twice because we keep a hash table per compilation anyway.

Fixes angular#4810
Fixes angular#5404
hansl added a commit that referenced this issue Mar 17, 2017
Before there was a bug that the file wasnt forced to rediagnose.

If the file changed, we wont diagnose it twice because we keep a hash table per compilation anyway.

Fixes #4810
Fixes #5404
@masaanli
Copy link

masaanli commented Mar 18, 2017

Thx, when RC3 is coming?

@ronnyek
Copy link

ronnyek commented Mar 28, 2017

Is there some sort of temporary workaround for this until the next rc comes along? Oh my bad... I'm assuming this should be in the 1.0.0 release?

I still see this very frequently... I've tried manually updating @ngtools/webpack as well as uninstaleld cli and re-installed. Probably 2-3 builds and then crtl+c to cancel serving only to restart

@rainstormza
Copy link

rainstormza commented Mar 31, 2017

still happens when I try to remove property from interface then errors doesn't show until I use ng serve again

@angular/cli: 1.0.0
node: 6.10.0
os: darwin x64
@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
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0

@hansl

@BobBDE
Copy link

BobBDE commented Apr 2, 2017

Yep this still happens to me too. Same versions as @rainstormza.

@luc-bertrand
Copy link

I am annoyed by this also, I found this while looking for a way to put the compiler in manual mode...

@adamdport
Copy link

@hansl My team is still having issues with this at @1.1.1. Has your fix been released yet or should I open a new issue?

@rainstormza
Copy link

@adamdport
it happen when you change class or interface (model) right ?

@BobBDE
Copy link

BobBDE commented Jun 16, 2017

@rainstormza
Hi,
I don't know for the classes but when I add or remove a attribut of an interface, I need to restart the server in order to make it work. If I don't I have a typescript error that blocked the compilation.

@tytskyi
Copy link

tytskyi commented Jun 16, 2017

@BobBDE @adamdport
I am also facing this when changing interfaces/tempaltes.
Current "hack" to make it re-compile - you need to change code in the way that i will be different when compiled. For example add code ;+4; above or below interface, of inside the function, and hit Save- where it will not produce compilation error. Then remove it when you are finished changing of interface.
This is ugly, but works faster than restart.

@vlad-shevchenko
Copy link

Having the same problem. Sometimes when I make any changes to my .ts files (not just interfaces), rebuild is initiated, browser page is reloaded, but compiled code stays as if I didn't make the latest change.

Windows 10
@angular/cli: 1.0.0
node: 7.2.0
os: win32 x64
@angular/common: 4.2.2
@angular/compiler: 4.2.2
@angular/core: 4.2.2
@angular/forms: 4.2.2
@angular/http: 4.2.2
@angular/platform-browser: 4.2.2
@angular/platform-browser-dynamic: 4.2.2
@angular/router: 4.2.2
@angular/cli: 1.0.0
@angular/compiler-cli: 4.2.2

My (rather awful) workaround is to initiate a rebuild by making some dummy changes and saving source file. If you're using JetBrains IDEs, you can just add a whitespace anywhere and save file. IDE will remove unnecessary whitespace, but rebuild will still be initiated.

@achobanov
Copy link

Same issue here. Mostly encounter failure to rebuild after moving, or creating interfaces. The error message is "{file} has no exported member {Interface}".

OS: Linux Mint 18.2
angular: 4.0.0
angular/cli; 1.2.1

@HWiese1980
Copy link

Bug still exists. When is it going to be fixed? Pretty urgent in my book.

@angular/cli: 1.2.2
node: 6.11.1
os: win32 x64
@angular/animations: 4.4.4
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.2.2
@angular/compiler-cli: 4.4.4
@angular/language-service: 4.4.4

@HWiese1980
Copy link

I don't know if this is related, but it sounds quite like it. When installing angular-cli, I get the following warning:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

fsevents very much sounds like it's required to detect file changes and reinitiate the building process.

Or... how is that done on Windows?

@HWiese1980
Copy link

In the meantime I've updated to @angular/cli-1.5.0-beta.4. Bug/strange behavior persists.

@Chris2011
Copy link

I use cli 1.4.6, this error still exists, it is a pain in the ass, I have to cancel the serve task and start it again, each time, I got an error in the code.

@mariusc09
Copy link

It looks like this was fixed in 1.4.7
Just installed "@angular/cli": "1.4.7" and webpack is now compiling after a 'Failed to compile' error.

I'm on Windows 10.

  "@angular/animations": "^4.2.4",
  "@angular/common": "^4.2.4",
  "@angular/compiler": "^4.2.4",
  "@angular/core": "^4.2.4",
  "@angular/forms": "^4.2.4",
  "@angular/http": "^4.2.4",
  "@angular/platform-browser": "^4.2.4",
  "@angular/platform-browser-dynamic": "^4.2.4",
  "@angular/router": "^4.2.4",

  "@angular/cli": "1.4.7",
  "@angular/compiler-cli": "^4.2.4",
  "@angular/language-service": "^4.2.4",

@Chris2011
Copy link

Thx. Updated to 1.4.7 and it seems to be fixed :)

@MadeRelevant
Copy link

I still have this issue randomly with interfaces their signatures being updated. Using angular/cli ^1.4.8.

@Maximaximum
Copy link

The issue still persists. @angular/cli 1.6.0. :(

@Maximaximum
Copy link

I think this should be reopened

@jodavaga
Copy link

jodavaga commented May 7, 2018

The issue still persists. @angular/cli 1.7.4

@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
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.