I had the MIME type error Failed to load module script: The server responded with a non-javascript mime type of text/html earlier in my Angular app and I got it resolved.
However, I am unable to find a way on how to get notified of this error if it might happen again.
I'm using Sentry to detect errors in my Angular app to get notified of any errors. In this case, the MIME error pops up even before the main module is loaded where sentry is also initialized. In fact, the error means it is unable to find/load the main module.
Due to this issue, a blank white screen was shown by the browser and my production website was unusable for some time. There were no build issues.
- How can I detect and get alerted about this error if it ever happens again?
- Are there any external tools available that can monitor my application for such errors and notify me?
- What are the best practices currently being followed in the industry?
from How to detect MIME type error in Angular 9 app and get notified?
No comments:
Post a Comment