-
Notifications
You must be signed in to change notification settings - Fork 12k
Errors are reported differently depending on when you execute npm start
#17487
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
Reminds me of angular/angular#32213, but that's been fixed I think. |
This is actually expected and it's not any different from that of previous versions with AOT compilations. It happens more often since version 9, because AOT has been turned on by default which results in more errors being caught during build time instead of runtime.
Overall we definitely need to look into this more and evaluate how we can improve/align the DX around errors, and see how others are using fork type checking and reporting errors back to the browser via an overlay such as: My current suggestion would be to use the terminal as the source of truth for build related errors. |
Edit: fork-ts-checker-webpack-plugin does suffer from the same "issue" - https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options (see |
Thank you so much for looking into this and providing such detailed feedback. This is going to really confuse beginners, who may think:
I'd minimally suggest that this be included in the documentation: That they could see three different results depending on when they run the compiler and that the focus should be on the terminal window. This should include the text of the error (in the case of #1) so that hopefully it would show up in search results. This is what I had added to my course for beginners the first time I show them what will happen if they forget a step (such as forgetting to add a component to a module):
Thank you again! |
Yes i am having similar issue sometime i get can not get / then i look into web browser console then i look into terminal for errors. This is started in NG9 (probably of AOT) |
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?
Yes. In Angular v8 and before, the browser would consistently show errors, regardless of when you executed `npm start`Description
What you see in the browser when you have an error depends on when you execute `npm start`. You may get this:No error shown. Appears to display the last successfully compiled files.
You may get this:
Get error. This is very unhelpful, especially for Angular beginners. This appears if you run
npm start
after making an error. It appears that it cannot serve any files in this case.Or you may get lucky and get this:
This is much more helpful, but not consistently shown.
🔬 Minimal Reproduction
This is one example, but it happens with many different errors, such as forgetting to add a component to an Angular module:
<input type='text' [(ngModel)]='listFilter' />
(This is an error because we don't have listFilter defined and we have not imported FormsModule.)
I assume this is the behavior that we should see in every case.
cannot get
error.So depending on when the
npm start
is executed, the developer will see different results, some of which, like thecannot get
error, provide no information in the browser as to what is wrong.🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
Similar issues: #15887
The text was updated successfully, but these errors were encountered: