Angular cli 5 AOT gives Module not found can't resolve .ngfactory
See original GitHub issueType of Issue
[X] Bug Report
[ ] Feature Request
Description
When building bundle with ng-packagr, installing it in Angular 5 app and then trying to AOT the application, the compiler throws the error that it’s not able to find the referenced module.
How To Reproduce
- “ng-packagr -p ng-package.json” bundle and npm publish
- Install on new Angular 5 app (i.e. npm install)
- Using ngTools webpack 1.8.0 AOT the application
- Get errror. Example:
Expected Behaviour
Should not display message since bundle is already build
Version Information
ng-packagr: v2.0.0-rc.0
node: v8.8.1
@angular: v5.0.1
rxjs: v5.5.2
zone.js: v0.8.18
typescript: v2.6.1
Workaround: https://github.com/angular/angular-cli/issues/8284#issuecomment-341417325
Which is to include the library in the Include files of the tsconfig compilation
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
27 - Stack Overflow
When you run the ng build in angular 2, latest angular-cli automatically runs with --aot ... src/main.server.ts Module not found: Error: Can't resolve...
Read more >How to fix Ionic --prod Error: Module not found: module.ngfactory
I Honestly don't quite know which Angular AoT rule this breaks (AoT if used with the --prod flag) but if you have a...
Read more >angular/angular - Gitter
newly created project throws this. ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in ...
Read more >Switching from angular2-template-loader to @ngtools/webpack
Module not found : Error: Can't resolve './main.ts.ngfactory' in '/path/to/application/directory'. Another strange problem that I don't ...
Read more >how should I generate the app.module.ngfactory.ts file? - Reddit
I'm trying to get my ng2 app set up for AOT. It seems that an app.module.ngfactory.ts file is needed for this instead of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
removing
"rootDir": "./src",
from thetsconfig.json
resolved the problem for usThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.