Blocked because of a disallowed MIME type (“text/html”) : Angular 8 deployed on tomcat 9.0.30 fails to serve the assets

 <base href="/">

is the issue , change it to your context root . Or change it to

<base href=".">

Browser is unable to find your JS file because it looks for JS file relative to base href.

Your base href= "/" , so it looks for all js file in the in "localhost:8080/", but your JS files might have present in "localhost:8080/someRoot"

One more solution you can think of is, deploying in the ROOT folder of tomcat with out context root , if that is allowed for your project


The server thinks that your JS file is a HTML file.

This may be because the server-side recognition is buggy or the JS file is non-existent (and the server does not send a 404 status code?) or there is no js in it.

Because of that, it sends the Content-Type text/html.

The browser sees the content type, thinks this is no css and does not allow it.

If you specify the type(client side) or change the type server-side, it should work.