-
Notifications
You must be signed in to change notification settings - Fork 12k
Ng Build doesn't always fill Errors array for the Webpack 'done' hook #13870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As far as I was able to understand right now, the reason is that in |
At last, I was able to tweak the behaviour by changing the benchmark_1.time('AngularCompilerPlugin._emit');
const program = this._program;
const allDiagnostics = [];
const diagMode = (this._firstRun || !this._forkTypeChecker)
? gather_diagnostics_1.DiagnosticMode.All
: gather_diagnostics_1.DiagnosticMode.Syntactic; So by keeping the It seems that the kind of error, I have in my example isn't syntactic but semantic. I don't really see how does TS compiler differentiate one from another (stupid me), but much more interesting is how do I force it to run in |
It seems that the issue could be solved by adding a Still, I wonder whether we could keep the fork type checker process just pass the results back to the anbular_compiler_plugin and further to the Gonna add a feature request for that. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No
Description
When using Webpack
done
hook together withng build --watch
command, thestats
object, passed to the hook as a parameter doesn't always havestats.compilation.errors
array filled even if there are errors and the build has failed.Although it could be seen as a minor issue, it makes impossible using of popup build notifiers like the
webpack-notifier
because these rely on errors presence in thestats
object.🔬 Minimal Reproduction
The sample code could be found at
https://github.com/Usurer/bugreports.NgCliBuildWebpackHooks
ng new my-app
done
hook:Add custom webpack config by following instructions for
ngx-build-plus
:run
ng add ngx-build-plus
add
webpack.partial.js
to the project root with the following contents:run
ng build --watch --extra-webpack-config webpack.partial.js
Result as expected: no build errors and an empty errors array logged to console.
Now open
/src/app/app.component.ts
and add the following new line to the end of the file:xxx;
Check the build console.
Expected: "Cannot find name xxx" error logged twice - as a part of an error object in an errors array and as a regular build error message.
Actual: errors array logged as an empty array, "Cannot find name xxx" error is shown in the console as a regular build error message.
Now cancel the
build --watch
. Make sure that you still have anxxx
line in theapp.component.ts
and runng build --watch --extra-webpack-config webpack.partial.js
again.Check the build console.
Result as expected: "Cannot find name xxx" error logged twice - as a part of an error object in an errors array and as a regular build error message.
Remove the
xxx
line and check the console.Result as expected: Errors array is empty, build succeeded.
Once again add the
xxx
line and check the consoleExpected: "Cannot find name xxx" error logged twice - as a part of an error object in an errors array and as a regular build error message.
Actual: errors array logged as an empty array, "Cannot find name xxx" error is shown in the console as a regular build error message.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: