Skip to content

ng serve hangs at 70% #3594

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
ghost opened this issue Dec 16, 2016 · 23 comments
Closed

ng serve hangs at 70% #3594

ghost opened this issue Dec 16, 2016 · 23 comments

Comments

@ghost
Copy link

ghost commented Dec 16, 2016

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

$ ng --version
angular-cli: local (v1.0.0-beta.23, branch: master)
node: 6.9.2
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

It was working fine in beta-21.
Latest version results in this error. I desperately need this version as I need the i18n features.

The log given by the failure.

Normally this include a stack trace and some more information.

$ ng serve
** NG Live Development Server is running on http://localhost:4200. **
 70% building modules 1290/1290 modules 0 active

Mention any other details that might be useful.

Another issue ( #3508 ) with this problem was marked as duplicate of ( #3368 ). That's not right. In my case, in beta-21 the application compiles fine in AOT. So, as since beta-22 AOT is enabled by default, it should also still work. So it may be an AOT issue, but by making AOT no longer default, this issue won't be fixed.

I am starting to lose confidence in Angular CLI. I am aware it's work in progress, but in every commit I get random errors. I've tried most of the commits since i18n was introduced, and every one gives a different error.
And the fact that .beta-22 introduced a major bug (AOT enabled by default) doesn't help either.
You're doing a great job, but keep in mind that people use this tool for production websites.

@antonybudianto7
Copy link

antonybudianto7 commented Dec 16, 2016

same here,

TEMPORARY WORKAROUND
downgrading to @ngtools/webpack 1.1.9 solved this. By downgrading I mean you add @ngtools/webpack as dependency to your package.json

@schroedan
Copy link

In my case downgrading to tslint 4.0.2 solved the problem.

@donotfold
Copy link

@antonybudianto7 and @schroedan ... didn't work for me :/

@antonybudianto
Copy link
Contributor

@donotfold have you cleaned your node_modules before re-installing?

@KeksKlip
Copy link

Have the same issue.
I deleted node_modules
I linked angular-cli in my project to use the latest beta.23
And put @ngtools/webpack 1.1.9 in my package.json
Run npm install
Run ng init to re-initiate my project.

But ng serve stucks on 70%

@antonybudianto
Copy link
Contributor

btw I used beta.22-1, not beta.23, sorry forgot to mention it.

@SebastianSchenk
Copy link

I have the same issue with beta.22-1

@mairanteodoro
Copy link

Having the same issue with beta.21. Tried rm -rf node_modules to no avail.

@nikoTM
Copy link

nikoTM commented Dec 16, 2016

+1

EDIT: Apparently it has something to do with yarn, when I do rm -rf node_modules && npm install, ng serve works as intended, but yarn install breaks it. Somewhere a version gets screwed I guess.

ANOTHER EDIT:

NPM warn with 1.0.0beta.22-1 package.json:

npm WARN [email protected] requires a peer of tslint@^3.0.0 but none was installed.

Yarn warnings:

warning Incorrect peer dependency "@angular/compiler@~2.3.1".
warning Incorrect peer dependency "@angular/compiler-cli@~2.3.1".
warning Incorrect peer dependency "@angular/core@~2.3.1".
warning Unmet peer dependency "@angular/tsc-wrapped@~0.5.0".

@mairanteodoro
Copy link

@nikoTM It definitely has something to do with yarn; after rm -rf node_modules && npm install, I had to upgrade "@angular/compiler" and "@angular/core" from 2.0.0 to 2.2.3 in my package.json. Then, I had lots of warnings from npm but finally got ng serve to work. ;)

@antonybudianto
Copy link
Contributor

Looks like it's solved
webpack/webpack-dev-middleware#156

cc @hansl

@hansl
Copy link
Contributor

hansl commented Dec 17, 2016

Right. The process now terminates instead. I just submitted a PR for a better error message and, in the case of watching (serve or build --watch), stay in process and watch file changes.

@hansl hansl closed this as completed Dec 17, 2016
@Kosmonaft
Copy link

Fresh install of angular-cli@latest(1.0.0-beta.22-1) and ng serve is hanging on 70%

@ghost
Copy link
Author

ghost commented Dec 19, 2016

@Kosmonaft I've raised this issue on the master branch. So either revert to beta.21, or clone the repository and run from there.
I've confirmed that the bug has been resolved in master branch.

@leon
Copy link
Contributor

leon commented Dec 19, 2016

I got it compiling by changing the codelyzer to version 2, but I'm not sure this was the culprit.

angular 2.2.3
angular-cli beta 22-1

"codelyzer": "2.0.0-beta.1",

@natete
Copy link

natete commented Dec 19, 2016

I think it's related with how yarn is resolving the dependencies. It looks like it's installing versions that have NOT been published on npm such us version 1.2.0 of @ngtools/webpack instead of the last published version (1.1.9) and the same thing happens with codelyzer

@ngtools/package in npm displaying 1.1.9 is the latest of 13 releases

@Kosmonaft
Copy link

@rolandoldengarm I clone the repository and now I'm getting this error:
notarget No compatible version found: [email protected]

My current version:
fatal: Not a git repository (or any of the parent directories): .git angular-cli: local (v1.0.0-beta.23, branch: ??) node: 6.9.1 os: win32 x64

@ghost
Copy link
Author

ghost commented Dec 20, 2016

  1. Clone the repository into a folder
  2. Go to that folder and run "npm link"
  3. Go to your Angular 2 project, and run "npm link angular-cli"

Just as documented here: https://github.com/angular/angular-cli#development-hints-for-hacking-on-angular-cli
@Kosmonaft

@Sixthdim
Copy link

I had the same issue after updating to [email protected], @angular@2.3.1, and [email protected]. I got around the 70% build hang by downgrading to [email protected] and installing [email protected] as a dev dependency.

@Kosmonaft
Copy link

Workaround:

  1. ng build
  2. ng server

For me in this way is working

@pleerock
Copy link

I had this issue when I tried to use cli with angular 2. Then I switched to angular-webpack-starter which worked fine. Now Im trying to upgrade my app to angular 5 I have this issue again. It just freezes on 76% forever without any errors or something on how I can fix this issue. When I configure my app from scratch using angular 5 and systemjs - it works fine.

@ferrisColin
Copy link

@Kosmonaft Thank you!!!! This issue took me nearly 16 hours to figure out. Needless to say, I tried nearly everything to resolve the issue, however, to no avail, nothing worked.

ng build
ng server

is all it took. Also, below are some of my versions:

Angular CLI: 1.7.4
Node: 6.9.2
OS: win32 x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.4.2
webpack: 3.12.0

Another thing I should mention is that I had to downgrade the ngx-spinner module from the latest version to version 6.0.0.

@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
None yet
Projects
None yet
Development

No branches or pull requests