x)- [ ] bug report -> please search issues before submitting
- [ X ] feature request
ngtools/webpack: 1.4.2
Use AOT plugin with webpack, and write code that does not compile.
Module not found: Error: Can't resolve './../../aot/my-app/src/app/app.module.ngfactory'
The above error message happens because AOT compilation fails and app.module.ngfactory is not created. The plugin should log AOT compilation errors to console.
Also my webpack build hangs and does not exit with an error when this happens. Unsure if that issue is specific to me, or a general issue that can be fixed in the plugin.
My quick fix was to add a catch here and log the error to console.
@Brocco @filipesilva I believe this ticket should be upgraded in priority. I spent several hours today trying to figure out why AOT build was failing. Ultimately it was the same issue as https://github.com/angular/angular-cli/issues/7113. Looks like many developers struggled today with this cryptic error message.
Referencing a similar feature request that came in yesterday. https://github.com/angular/angular-cli/issues/7126
Absolutely this needs to be supported. Its maddening to try and figure out which part of my code broke AOT -- and the only way to do it is to incrementally removing parts of my app.
For everyone struggling with this, here's a temporary workaround I came up with to get the full errors.
In your project, open the file node_modules\@ngtools\webpack\src\plugin.js
Add the following to the end of line 374: .catch(e => console.error(e))
Now you'll get the REAL error message :smile:
Thanks @PachowStudios ! I was having a hard time trying to find the real error 馃
Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
For everyone struggling with this, here's a temporary workaround I came up with to get the full errors.
In your project, open the file
node_modules\@ngtools\webpack\src\plugin.jsAdd the following to the end of line 374:
.catch(e => console.error(e))Now you'll get the REAL error message :smile: