Error when building with webpack in angular-cli project
Closed this issue · 2 comments
When using jsnlog in an Angular project (generated with @angular/cli 1.2.6) building for production and ahead-of-time (ng build --prod --aot
), the build process can't resolve the module.
ERROR in ./src/$$_gendir/app/app.module.ngfactory.ts
Module not found: Error: Can't resolve 'jsnlog/Definitions/jl' in 'C:\Users\Name\Code\JSNLogWebpack\src\$$_gendir\app'
@ ./src/$$_gendir/app/app.module.ngfactory.ts 13:0-44
@ ./src/main.ts
@ multi ./src/main.ts
Building with ng build
is completing without an error.
I generated a sample project: https://github.com/hzahradnik/JSNLogWebpack
Thanks for your feedback and for the sample project. This allowed me to reproduce the error.
I have zero experience with the AOT, and the error messages from the compiler are very unhelpful, even when using --verbose. So far, I haven't been able to pinpoint the problem.
I read the "Ahead-of-Time Compilation" page on the Angular 2 site
https://angular.io/guide/aot-compiler
This describes a series of changes that need to be made to your tsconfig.json and src/main.ts files to make your app ready for AOT. I noticed that those changes hadn't been made in the sample project.
Seeing my lack of experience with AOT and lack of time, could you update those files and see if it works. If not, feel free to open this issue again. Or better, find the issue yourself and send me a pull request - that is a much speedier and certain way of getting this resolved.
Hi there! Any movement on this? I have even less experience than you, I'm sure :-)