错误./src/$$_gendir懒惰。找不到模块

时间:2017-12-13 11:53:20

标签: angular angular-cli aot

我有一个可怕的问题,AOT构建我的应用程序。在开发模式中,一切都很好。但是,当我尝试构建我的应用程序时,我收到了错误:

ng build -prod --build-optimizer --app 0
ng build --aot --app 1
webpack -p

我正在尝试安装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 ,但它仍无效。

我的app /

中使用的库版本
enhanced-resolve@3.3.0

任何人都有类似的错误,可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

这可能是由于您引用的路径不正确。请再次检查您要导入的模块的路径。