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

Solution using npm install [email protected] --save not working for me

zinchenkoivan avatar Feb 08 '18 14:02 zinchenkoivan

After doing the npm install copy-webpack I get Module build failed: Error: Cannot find module 'cuint' Seems apt

AndrewAllison avatar Feb 08 '18 14:02 AndrewAllison

npm install [email protected] works also here. many thanks

neural22 avatar Feb 08 '18 14:02 neural22

npm install [email protected] Will this work for our project as below version "@angular/cli": "1.6.1", "@angular/compiler-cli": "5.1.1", "typescript": "2.4.2"?

amithole1987 avatar Feb 08 '18 14:02 amithole1987

Same problem here

mdybich avatar Feb 08 '18 14:02 mdybich

Thanks @danielszenasi ! That worked for me.

npm install [email protected]

osmanakyuz avatar Feb 08 '18 14:02 osmanakyuz

npm install [email protected] --save didn't work for my case! Any other solution, please?

thovo avatar Feb 08 '18 14:02 thovo

npm install [email protected] -save worked. many thanks

jeen-github avatar Feb 08 '18 14:02 jeen-github

You should not --save the module to your project.json, because it is only a temporary fix. Instead, use a lock file. Read the explanations from @filipesilva above.

hnrchrdl avatar Feb 08 '18 14:02 hnrchrdl

npm install [email protected] -save didn't help in my case

dandro32 avatar Feb 08 '18 14:02 dandro32

if npm install [email protected] doesn`t help try add in package.json:

"optionalDependencies": { "copy-webpack-plugin": "4.3.1" }, "resolutions": { "copy-webpack-plugin": "4.3.1" }

zinchenkoivan avatar Feb 08 '18 15:02 zinchenkoivan

Have fix https://github.com/webpack-contrib/copy-webpack-plugin/pull/221, just wait release in near minutes

alexander-akait avatar Feb 08 '18 15:02 alexander-akait

Same issue here on Bash windows

emadhajjar avatar Feb 08 '18 15:02 emadhajjar

What do I need to do exactly once webpack-contrib/copy-webpack-plugin#221 has passed Travis-CI?

BernhardBehrendt avatar Feb 08 '18 15:02 BernhardBehrendt

Same

DenisKhay avatar Feb 08 '18 15:02 DenisKhay

hi guys, i add in my package.json ... "copy-webpack-plugin": "4.3.0", ... and solved my problems!

maicongobbi avatar Feb 08 '18 15:02 maicongobbi

I get the same problem when deploying to Heroku.

kabe5965 avatar Feb 08 '18 15:02 kabe5965

Hi, @maicongobbi Will this work for below version "@angular/cli": "1.6.1", "@angular/compiler-cli": "5.1.1", "typescript": "2.4.2"?

amithole1987 avatar Feb 08 '18 15:02 amithole1987

OK IT WORKED

THANKS

node v9.3.0 npm 5.6.0

"@angular/cli": "1.6.8",
"@angular/compiler": "^5.2.0",
"typescript": "^2.6.2",
"@types/node": "^9.4.2",
"copy-webpack-plugin": "^4.4.1",

MEANSTACKDIGITAL avatar Feb 08 '18 15:02 MEANSTACKDIGITAL

the new copy-webpack-plugin rev fixes it

thank you mate

MEANSTACKDIGITAL avatar Feb 08 '18 15:02 MEANSTACKDIGITAL