-
Notifications
You must be signed in to change notification settings - Fork 12k
@ngtools/webpack HMR compilation errors ignored #15372
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
Hi, thanks for opening the issue. There are separate issues here; 1. Forked type checking errors not being sent to webpack 2. Compilation errors in (AOT) first run errors are not being recoverable For the former, I am not sure if there was any reason why we solely log such error message instead of providing them in webpack compilation. Looping in @filipesilva as he probably knows. |
First run errors AOT should be recoverable. It sounds like a bug that they aren't. |
Yeah, that for sure, what about the first problem? |
It's intended that type errors aren't sent to webpack when using the forked type checker. If they were, and they blocked the compilation, then there's no point in having a forked type checker as rebuilds would just take longer. |
Thanks for answers. Could be part of first problem solved by using https://www.npmjs.com/package/fork-ts-checker-webpack-plugin for notifications? Is there any way to be able to send these errors to HMR report in browser without disabling forkedTsCheck? |
I don't think it makes sense to use a separate forked TS type checker. You'd just get twice the number of TS type checks, and it wouldn't work correctly in AOT mode. It might be possible to send type errors to the HMR report in between compilations, it's just not something we've looked at. |
It would be great to have some information about compilation errors at least in browser, because right now i dont know that there are errors application usually works and then on server application fails becuase there is no HMR build and i send not compilable application to repository, because i dont check console so often. Thanks |
@filipesilva you know what is interesting? Sometimes, i dont know what have i done but, running @ngtools/webpack gets in state, when everything is working even AOT compilation errors are shown in notifications and also through HMR Only difference what i see is that if it is not displayed, it is case when error is displayed in console as regular text, but if it is displayed as "error" in red it gets everywhere it should. So it means it is possible to make it working :). |
@filipesilva I figured it out. Now i know what to do to make it working. If you create Thanks |
Hi @alan-agius4 will this land in version 11? Thx anyway :) |
That would be available in 11.1 |
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
)not using angular cli, but @ngtools/webpack
Is this a regression?
Dont know if this ever worked with
@ngtools/webpack
because i havent been using it during development before.Description
When you create compilation error in project, like you add some unused import, compilation throws error in console, but this error is not displayed in
WebpackNotifierPlugin
nor in browser throughHMR
. When you useawesome-typescript-loader
it works correctly.What is even weirder is that if you stop compilation process and run it again, error is thrown correctly everywhere, only during
HMR
change it is not handled correctly.If you fix initial problem and
HMR
is running you will get errorand you have to restart
npm start
command. All three mentioned things are slowing development with@ngtools/webpack
compared toawesome-typescript-loader
.🔬 Minimal Reproduction
download this https://github.com/kukjevov/ngtools-error
#1
#2
#3
🔥 Exception or Error
See minimal reproduction part
🌍 Your Environment
The text was updated successfully, but these errors were encountered: