angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

20%

Open elvisbegovic opened this issue 9 years ago • 10 comments

Windows 10

I use cli v22-1

So I don't know why I don't have message error LIKE WHEN RUNNING ng build command !

I spend so much time to understand why ng serve is blocking at 20% without any kind of errors...

But when running ng build I have a great error that help me to see where is the problem :

Template parse errors:
There is no directive with "exportAs" set to "ngForm" ("<h1>Template Driven</h1>
<form (ngSubmit)="onSubmit(f)" [ERROR ->]#f="ngForm">...............

So I just remove my FormsModule ! after specify my ng serve works !

elvisbegovic avatar Dec 07 '16 08:12 elvisbegovic

same for me

fsx999 avatar Dec 07 '16 13:12 fsx999

This (ng serve hanging at 20%) started happening for me when I tried running with TypeScript 2.1. Reverting to ~2.0.3 resolves it.

drew-moore avatar Dec 07 '16 20:12 drew-moore

The problem here is not what is the solution to resolve, the problem is I expect from ng serve get me same error like ng build to tell me what is wrong otherwise impossible to find !

elvisbegovic avatar Dec 07 '16 20:12 elvisbegovic

I meant it resolves the problem, not the issue you've raised.

Your issue is valid, but cli doesn't explicitly support TS 2.1 yet and it seemed worthwhile to note that this looks like a 2.1-specific problem.

drew-moore avatar Dec 07 '16 21:12 drew-moore

This problem happened TS 2.0.10, too.

Followings are the condition where the problem happens. --- ng build stopped at 20% --- 19% building modules 78/82 modules 4 active ...k/node_modules/requires-port/index. 19% building modules 79/82 modules 3 active ...k/node_modules/requires-port/index. 19% building modules 80/82 modules 2 active ...k/node_modules/requires-port/index. 19% building modules 81/82 modules 1 active ...2/temp/mixidea_cowork/src/styles.sc 19% building modules 81/83 modules 2 active ...xidea_cowork/node_modules/ms/index. 19% building modules 82/83 modules 1 active ...2/temp/mixidea_cowork/src/styles.sc 19% building modules 83/84 modules 1 active ...de_modules/css-loader/lib/css-base. 20% building modules 84/84 modules 0 active --> stop here and nothing happened from here

---- project package.json---- { "angular-cli": {}, "scripts": { "start": "ng serve", "lint": "tslint "src/**/*.ts"", "test": "ng test", "pree2e": "webdriver-manager update", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "2.2.3", "@angular/compiler": "2.2.3", "@angular/core": "2.2.3", "@angular/forms": "2.2.3", "@angular/http": "2.2.3", "@angular/platform-browser": "2.2.3", "@angular/platform-browser-dynamic": "2.2.3", "@angular/router": "3.2.3", "@ngrx/core": "^1.2.0", "@ngrx/store": "^2.2.1", "angularfire2": "^2.0.0-beta.6", "core-js": "^2.4.1", "ng2-bootstrap": "^1.1.16", "rxjs": "5.0.0-beta.12", "socket.io-client": "^1.7.1", "socket.io-stream": "^0.9.1", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": { "@angular/compiler-cli": "2.2.3", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.22-1", "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.9", "ts-node": "1.2.1", "tslint": "^4.0.2", "typescript": "^2.0.10", "webdriver-manager": "10.2.5" } } -- Device environment --

ubuntu 14.04.5 LTS node v6.5.0

morninng avatar Dec 08 '16 03:12 morninng

I am not sure what to do anymore. Yesterday my CLI app was working without issue using TypeScript 2.0.10, Angular 2.2.4. So today I saw the release of Angular 2.3.0. I updated my dependencies and that is when can't resolve module at 20% showed up. I have since reverted all the changes I made today back to the way my app was when it was working Yesterday, and now I am still having the same problem. Even when I use TypeScript 2.0.3. I am on a Windows machine with node 7. No idea what to do...

jwuliger avatar Dec 08 '16 21:12 jwuliger

serve blocks because webpack-dev-server does not support async plugins; when an error happens in an async plugin webpack-dev-server just stops working, instead of reporting the error and waiting for a change.

ng build should give you the proper error to fix here. Once that error is fixed, ng serve will be working fine.

hansl avatar Dec 08 '16 21:12 hansl

It's not reason to close issue or add documentation to teach to users that they need run ng build if serve is blockin! Thanks I think issue and bug is always here issue need to be open to show people what they can do, thanks

elvisbegovic avatar Dec 08 '16 22:12 elvisbegovic

Just to add to what I said above: https://github.com/webpack/webpack-dev-middleware/issues/156.

hansl avatar Dec 10 '16 02:12 hansl

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.