Angular-cli: Module build failed: TypeError: Cannot read property '_statSync' of undefined

Created on 31 Oct 2018  路  6Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 1.7.4
Node: 8.12.0
OS: linux x64
Angular: 5.2.11
@angular/cli: 1.7.4
@angular/forms: 5.2.10
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.4.2
webpack-node-externals: 1.7.2
webpack: 3.12.0

Repro steps

@angular/cli: 1.7.4

ng new app-ng5
ng build -prod

The log given by the failure

ERROR in ./src/app/app.module.ngfactory.js
Module build failed: TypeError: Cannot read property '_statSync' of undefined
at stat (/projects/test/app-project/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:26:29)
at toDepDetails (/projects/test/app-project/node_modules/cache-loader/dist/index.js:66:5)
at arrayIterator (/projects/test/app-project/node_modules/neo-async/async.js:3780:9)
at timesSync (/projects/test/app-project/node_modules/neo-async/async.js:2292:7)
at Object.mapLimit (/projects/test/app-project/node_modules/neo-async/async.js:3775:5)
at Array. (/projects/test/app-project/node_modules/cache-loader/dist/index.js:89:18)
at arrayEachFunc (/projects/test/app-project/node_modules/neo-async/async.js:2512:19)
at Object.parallel (/projects/test/app-project/node_modules/neo-async/async.js:6867:9)
at Object.loader (/projects/test/app-project/node_modules/cache-loader/dist/index.js:88:9)
ERROR in ./node_modules/core-js/es7/reflect.js
Module build failed: TypeError: Cannot read property '_statSync' of undefined
at stat (/projects/test/app-project/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:26:29)
at toDepDetails (/projects/test/app-project/node_modules/cache-loader/dist/index.js:66:5)
at arrayIterator (/projects/test/app-project/node_modules/neo-async/async.js:3780:9)
at timesSync (/projects/test/app-project/node_modules/neo-async/async.js:2292:7)
at Object.mapLimit (/projects/test/app-project/node_modules/neo-async/async.js:3775:5)
at Array. (/projects/test/app-project/node_modules/cache-loader/dist/index.js:89:18)
at arrayEachFunc (/projects/test/app-project/node_modules/neo-async/async.js:2512:19)
at Object.parallel (/projects/test/app-project/node_modules/neo-async/async.js:6867:9)
at Object.loader (/projects/test/app-project/node_modules/cache-loader/dist/index.js:88:9)
ERROR in ./node_modules/@angular/platform-browser/esm5/platform-browser.js
Module build failed: TypeError: Cannot read property '_statSync' of undefined
at stat (/projects/test/app-project/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:26:29)
at toDepDetails (/projects/test/app-project/node_modules/cache-loader/dist/index.js:66:5)
at arrayIterator (/projects/test/app-project/node_modules/neo-async/async.js:3780:9)
at timesSync (/projects/test/app-project/node_modules/neo-async/async.js:2292:7)
at Object.mapLimit (/projects/test/app-project/node_modules/neo-async/async.js:3775:5)
at Array. (/projects/test/app-project/node_modules/cache-loader/dist/index.js:89:18)
at arrayEachFunc (/projects/test/app-project/node_modules/neo-async/async.js:2512:19)
at Object.parallel (/projects/test/app-project/node_modules/neo-async/async.js:6867:9)
at Object.loader (/projects/test/app-project/node_modules/cache-loader/dist/index.js:88:9)
ERROR in ./node_modules/zone.js/dist/zone.js
Module build failed: TypeError: Cannot read property '_statSync' of undefined
at stat (/projects/test/app-project/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:26:29)
at toDepDetails (/projects/test/app-project/node_modules/cache-loader/dist/index.js:66:5)
at arrayIterator (/projects/test/app-project/node_modules/neo-async/async.js:3780:9)
at timesSync (/projects/test/app-project/node_modules/neo-async/async.js:2292:7)
at Object.mapLimit (/projects/test/app-project/node_modules/neo-async/async.js:3775:5)
at Array. (/projects/test/app-project/node_modules/cache-loader/dist/index.js:89:18)
at arrayEachFunc (/projects/test/app-project/node_modules/neo-async/async.js:2512:19)
at Object.parallel (/projects/test/app-project/node_modules/neo-async/async.js:6867:9)
at Object.loader (/projects/test/app-project/node_modules/cache-loader/dist/index.js:88:9)
ERROR in ./node_modules/@angular/core/esm5/core.js
Module build failed: TypeError: Cannot read property '_statSync' of undefined
at stat (/projects/test/app-project/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:26:29)
at toDepDetails (/projects/test/app-project/node_modules/cache-loader/dist/index.js:66:5)
at arrayIterator (/projects/test/app-project/node_modules/neo-async/async.js:3780:9)
at timesSync (/projects/test/app-project/node_modules/neo-async/async.js:2292:7)
at Object.mapLimit (/projects/test/app-project/node_modules/neo-async/async.js:3775:5)
at Array. (/projects/test/app-project/node_modules/cache-loader/dist/index.js:89:18)
at arrayEachFunc (/projects/test/app-project/node_modules/neo-async/async.js:2512:19)
at Object.parallel (/projects/test/app-project/node_modules/neo-async/async.js:6867:9)
at Object.loader (/projects/test/app-project/node_modules/cache-loader/dist/index.js:88:9)

Most helpful comment

Resolved the issue by installing cache-loader version 1.2.2.

All 6 comments

Resolved the issue by installing cache-loader version 1.2.2.

Thanks guys :+1:

Yeah its working after adding "cache-loader": "1.2.2" " in package.json.
Thanks @H--o-l @santoshyadav198613

It worked for me too. Thank you very much

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajjejosefsson picture rajjejosefsson  路  3Comments

NCC1701M picture NCC1701M  路  3Comments

hareeshav picture hareeshav  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments