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

Had the same issue. Resolved by npm install [email protected]. angular-cli installed [email protected] which somehow breaks angular-cli.

angular cli: 1.6.8 node: 6.11.5 os: win 10 angular : 4.4.6

Thanks @neshkatrapati

hnrchrdl avatar Feb 08 '18 12:02 hnrchrdl

worked for me too... thanks guyz... tired of these breaking changes lately :-/

ilivestrong avatar Feb 08 '18 12:02 ilivestrong

@hnrchrdl

+1

This also works for me

ccoplestone avatar Feb 08 '18 12:02 ccoplestone

Thanks @danielszenasi that fix the problem

cmd : npm install [email protected]

Angular CLI: 1.6.6 Node: 8.9.4 OS: linux x64 Angular: 5.2.4

NajlaBH avatar Feb 08 '18 12:02 NajlaBH

God bless u man @danielszenasi

pedrokelvin avatar Feb 08 '18 12:02 pedrokelvin

The same here

oleg-vasilyev avatar Feb 08 '18 12:02 oleg-vasilyev

thanks

arashroot avatar Feb 08 '18 12:02 arashroot

Thanks, @danielszenasi, I just updated my Gitlab CI with "npm install [email protected]" and everything works fine!!!

MehranJanfeshan avatar Feb 08 '18 12:02 MehranJanfeshan

but... the people that have solved the problem: u had installed copy-webpack-plugin before? With this the problem not is solved for me :(

TypeError: callbacks[i] is not a function 13:35:39 at Storage.finished (/home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15) 13:35:39 at /home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9 13:35:39 at /home/jenkins/.jenkins/workspace/ckend_mcdonalds-cms_develop-KUGBU6RPL4XOVDQHQ263X6SXIV33TJD4ZP4ZTNWQABGBLS2LSMLQ/node_modules/graceful-fs/polyfills.js:287:18 13:35:39 at FSReqWrap.oncomplete (fs.js:123:15)

mcanelo avatar Feb 08 '18 12:02 mcanelo

does npm install [email protected] command have to be ran with --save or --save dev?

jbarber2016 avatar Feb 08 '18 12:02 jbarber2016

same here like @mcanelo

BreadBomb avatar Feb 08 '18 12:02 BreadBomb

@jbarber2016 npm install --only=dev [email protected]

jmesa-sistel avatar Feb 08 '18 12:02 jmesa-sistel

@danielszenasi, the Nobel Peace Prize goes for you, man :)

Thanks a lot!

cristianomartinsdias82 avatar Feb 08 '18 12:02 cristianomartinsdias82

@mcanelo Check if you have ^ in package.json, remove it to force to downgrade the package if you use npm install in a jenkins task

jmesa-sistel avatar Feb 08 '18 12:02 jmesa-sistel

Thanks ;) @danielszenasi

xDveGax avatar Feb 08 '18 12:02 xDveGax

same here on windows 10

Aastha05 avatar Feb 08 '18 12:02 Aastha05

npm install [email protected]

Is functional for me too. By installing npm 5+ and making package-lock.json on that version solved problem on whole building system. Thanks for that advice.

Ernedar avatar Feb 08 '18 12:02 Ernedar

awesome stuff thanks

jbarber2016 avatar Feb 08 '18 12:02 jbarber2016

npm install [email protected]

worked for me, if executed from project folder.

thanks @danielszenasi

marcelocella204 avatar Feb 08 '18 12:02 marcelocella204

npm install [email protected] worked for me. Thank you!!!

mhattori avatar Feb 08 '18 12:02 mhattori