0

I have a horrible problem with AOT build my app. In development mode everything's fine. But when i try build my app i got error:

ERROR in ./src/$$_gendir lazy
Module not found: Error: Can't resolve 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts' in 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir'
resolve 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts' in 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir'
  using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir)
    using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir/app/view-auth/auth.module.ngfactory.ts)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts.js doesn't exist
      as directory
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts doesn't exist
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts.ts]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts.js]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-auth\auth.module.ngfactory.ts]
 @ ./src/$$_gendir lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.ts
ERROR in ./src/$$_gendir lazy
Module not found: Error: Can't resolve 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts' in 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir'
resolve 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts' in 'C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir'
  using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir)
    using description file: C:\Users\jarkro\IdeaProjects\vlo-frontend\package.json (relative path: ./src/$$_gendir/app/view-ewniosek/ewniosek-views/ewniosek.module.ngfactory.ts)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts.js doesn't exist
      as directory
        C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts doesn't exist
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts.ts]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts.js]
[C:\Users\jarkro\IdeaProjects\vlo-frontend\src\$$_gendir\app\view-ewniosek\ewniosek-views\ewniosek.module.ngfactory.ts]
 @ ./src/$$_gendir lazy
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi ./src/main.ts

I was trying install enhanced-resolve@3.3.0 but it still does not work.

Below version of libraries used in my app/

Angular CLI: 1.6.0
Node: 8.9.3
OS: win32 x64
Angular: 4.4.1
... animations, common, compiler, core, forms, http
... platform-browser, platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular/compiler-cli: 4.4.5
@angular/tsc-wrapped: 4.4.5
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.5.3
webpack: 3.10.0

Anyone had similar error and can help me?

Jaroslaw K.
  • 5,224
  • 2
  • 39
  • 65
  • Have you checked the error message: "Field 'browser' doesn't contain a valid alias configuration"? – Carsten Ennulat Dec 13 '17 at 12:01
  • This will solve your problem, [enter link description here](https://stackoverflow.com/questions/43037590/field-browser-doesnt-contain-a-valid-alias-configuration) – Suhel Dec 13 '17 at 12:09

1 Answers1

0

This might be due to incorrect path you are referencing.Please check path of module you are importing once again.