Cannot use with AOT (angular-cli)

Angular 4
Using angular-cli

I receive errors when running a production AOT build: ng build -prod -aot.
My node_modules folder is located in a directory above /src.

`ERROR in ./src/$$_gendir/app/core/app.module.ngfactory.ts

Module not found: Error: Can’t resolve ‘angular-user-idle/user-idle.config’ in

resolve ‘angular-user-idle/user-idle.config’ in ‘/path/to/code/src/$$_gendir/app/core’

Parsed request is a module
using description file: /path/to/code/package.json (relative path: ./src/$$_gendir/app/core)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: /path/to/code/package.json (relative path: ./src/$$_gendir/app/core)
resolve as module
/path/to/code/src/$$_gendir/app/core/node_modules doesn’t exist or is not a directory

Author: Fantashit

1 thought on “Cannot use with AOT (angular-cli)

  1. The node module does not have the ts files included, which causes the above error.
    It has only *.d.ts files
    To fix the error i manually downloaded the files from the git project and pasted inside the node_modules\angular-user-idle

    • user-idle.config.ts
    • user-idle.module.ts
    • user-idle.service.ts
    • user-idle.ts

Comments are closed.