angular-cli: ng serve hangs at 70%

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 ( https://github.com/angular/angular-cli/issues/3508 ) with this problem was marked as duplicate of ( https://github.com/angular/angular-cli/issues/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.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 23 (5 by maintainers)

Most upvoted comments

+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 tslint-loader@2.1.5 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".

Workaround:

  1. ng build
  2. ng server

For me in this way is working

@antonybudianto7 and @schroedan … didn’t work for me 😕

In my case downgrading to tslint 4.0.2 solved the problem.

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

I had the same issue after updating to angular-cli@1.0.0-beta.22-1, @angular@2.3.1, and yarn@0.18.1. I got around the 70% build hang by downgrading to angular-cli@1.0.0-beta.21 and installing awesome-typescript-loader@3.0.0-beta.17 as a dev dependency.

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