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

Ng Serve fails at 95% - TypeError: callbacks[i] is not a function

Open DanielStep opened this issue 8 years ago • 184 comments

Versions

Angular CLI: 1.6.8
Node: 9.5.0
OS: darwin x64
Angular: 5.2.4
@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

  MacOS High Sierra 10.13.3

Repro steps

MacBook-Pro:~ daniel$ ng new test-proj ... Installed packages for tooling via npm. Successfully initialized git. Project 'test-proj' successfully created.

MacBook-Pro:~ daniel$ cd test-proj/

MacBook-Pro:test-proj daniel$ npm install up to date in 6.008s

MacBook-Pro:test-proj daniel$ ng serve

Observed behavior

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 95% emitting/Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
		callbacks[i](err, result);
		            ^

TypeError: callbacks[i] is not a function
    at Storage.finished (/Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
    at /Users/daniel/test-proj/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
    at /Users/daniel/test-proj/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:167:5)

Desired behavior

For build to be 100% successful and served to browser

DanielStep avatar Feb 08 '18 11:02 DanielStep

thanx @danielszenasi,i fixed the problem

samarahmad avatar Feb 08 '18 14:02 samarahmad

I had to use the resolutions fix proposed above in comment https://github.com/angular/angular-cli/issues/9550#issuecomment-364110779

darrenmothersele avatar Feb 08 '18 14:02 darrenmothersele

npm install [email protected] --save (worked for me)

alexnoise79 avatar Feb 08 '18 14:02 alexnoise79

thanks @danielszenasi 👍

wurmrobert avatar Feb 08 '18 14:02 wurmrobert

Thanks!!!!

danirp82 avatar Feb 08 '18 14:02 danirp82

same here! I'm going to try this npm install [email protected] --save

jamees avatar Feb 08 '18 14:02 jamees

Same problem here with ng build but I have a question about this. Should I add copy-webpack-plugin to my package.json ?

stoto34 avatar Feb 08 '18 14:02 stoto34

I guess not, we don't want temporary solutions in package json...

eugensunic avatar Feb 08 '18 14:02 eugensunic

@stoto34, you do that by adding '--save ' npm install [email protected] --save

idukic avatar Feb 08 '18 14:02 idukic

works for me!!! --> npm install [email protected] --save

JcOnSoftware avatar Feb 08 '18 14:02 JcOnSoftware

@idukic If I remove node_modules folder when I build my app, I will have the same problem for the next build right ? (FIY, it's all about production server)

stoto34 avatar Feb 08 '18 14:02 stoto34

thanks @danielszenasi

dkabul avatar Feb 08 '18 14:02 dkabul

npm install [email protected] --save (worked! ty)

tolosap avatar Feb 08 '18 14:02 tolosap

This is embarrassing.

stanislavromanov avatar Feb 08 '18 14:02 stanislavromanov

Running npm install [email protected] worked for me, thank you for the comments!!

Vanguard90 avatar Feb 08 '18 14:02 Vanguard90

@anilbobba1 Thanks, your pic helped me a great deal.

skinnerjames avatar Feb 08 '18 14:02 skinnerjames

I have the same problem with Angular 5 and CLI 1.6.7. And it just happened today, yesterday everything worked perfectly.

thovo avatar Feb 08 '18 14:02 thovo

npm install [email protected] --saveDev worked for me too

MatieuBonansea avatar Feb 08 '18 14:02 MatieuBonansea

same problem and solution, be patient fellow web developers the time is coming where we wont need to write a single line of javascript or compile to it. It is called webassembly....

xalikoutis avatar Feb 08 '18 14:02 xalikoutis

Yeah it is working indeed but i am not sure that this is a good solution anyway.... hope it will be fixed soon

Stradivario avatar Feb 08 '18 14:02 Stradivario