Ng Serve fails at 95% - TypeError: callbacks[i] is not a function
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
Funcionó con la degradacion de webpack...pero en serio...como ha podido llegar a pasar esto? Increible...
4.3.0 doesn't work for me, 4.3.1 does work.
We currently investigate problem https://github.com/webpack-contrib/copy-webpack-plugin/issues/217, please don't spam. Thanks.
I've the same error here:
Jenkins (running a slave container):

Local (running the same container that Jenkins):

And it seems that @ReToCode build also has the same issue: https://travis-ci.org/oscp/openshift-monitoring/builds/338959033?utm_source=github_status&utm_medium=notification
Thanks ;) @danielszenasi . That worked for me.
@losbeekos's solution has worked.
As I'm releasing a version today, I'll keep this workaround for now.
Worked for me, tnx to all! npm install [email protected] --save p.s. I had to put --save to add to package/json Fwi, is this temp solution, or?
Thank u @danny95djb and @danielszenasi! 4.3.1 does work for me
@idukic temp solution, because that package is at 4.4.0 and that's what broke the current setup
Remove "favicon.ico" from .angular-cli.json in "assets" field solve problem.
Investigate more deeply why it is happens
Same issue :(
D:\a\1\s*\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40 callbacks[i](err, result); ^ TypeError: callbacks[i] is not a function at Storage.finished (D:\a\1\s*\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40:15) at D:\a\1\s*\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9 at D:\a\1\s*\node_modules\graceful-fs\polyfills.js:287:18 at FSReqWrap.oncomplete (fs.js:153:5)
For me adding "copy-webpack-plugin": "4.3.1" to package.json solved the problem. Thanks guys
same here
For Yarn users, you can override the copy-webpack-plugin version used inside CLI by adding this to your package.json:
"resolutions": {
"copy-webpack-plugin": "4.3.0"
}
The semantics of this are slightly different than just manually overwriting the version once, you're telling yarn "if anything I am using depends on this package, ignore what version it thinks it wants and give it this one instead".
@MartynasStukas this will not work as you wanted to. If you are on localhost it's ok but if you use gitlab-ci to build your project this solution is messy. Yes, it's a workaround for now, but this is not the desired solution. Desired solution is to hit npm install and to work without installing other libraries.
"@angular/cli": "1.6.1", angular 5.0.0: solution using copy-webpack-plugin not working for me
same problem. npm install [email protected] fix for me
angular/cli: 1.6.8 angular/material: 2.0.0-beta.12 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.3.3 webpack: 3.10.0
I also want write story & participate in this issue, which received the largest nb. of comments within one hour!
npm install [email protected] --save
worked for me