Hacker News new | past | comments | ask | show | jobs | submit login

I just upgraded and got 'Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain".' from my S3 through CloudFront.

Seems like it's not adding 'type="text/javascript"' to <script> in index.html. When adding this manually, everything works.

Just FYI if others upgrade and seem to get the same errors.




My guess is you hit https://github.com/angular/angular/issues/30835. In version 8 we introduced differential loading to allow users on newer browsers to download smaller, modern bundles.

Modules, however, enforce strict mime type checking. As the comment below suggests, you should make sure your static file hosting serves JavaScript with the correct mime type.


Normally type=“text/javascript” is strictly unnecessary. You should try to configure whatever is uploading your site to S3 to set the Content-Type correctly as I believe that will also resolve your issue.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: