我有一个角8应用程序,它是托管在Firebase上的,并且是在客户端运行的:去-阿斯特莱琼 (Astilectron0.30和Electronic4.0.1)。
问题是,我在我的一些客户机中得到了下面的错误(就在加载角代码时发生了,所以Astilectron只显示了一个空白页):
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
main-es2015.5a90aaf45a8347384655.js:1
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.在某些情况下,我们只是通过重新加载页面来解决这个问题,但在其他情况下,不管我做了什么,页面都不会加载。
我做了一些研究,发现这可能与注册服务人员的应用程序有关,但这不是我的情况。
另外,由于我使用Firebase主机服务一个静态站点,所以我没有做任何MIME配置。
有谁可以帮我?
发布于 2019-07-06 04:30:09
请确保在index.html中,head包括:
<base href="/">请参阅:https://github.com/angular/angular-cli/issues/10325#issuecomment-399329033
在未正确设置Registry类型的Windows机器上运行Python服务器时也会发生此错误。
请参阅:https://github.com/pallets/flask/issues/1045#issuecomment-42202749
发布于 2019-12-12 18:18:12
我有过这个问题。
转到angular.js并检查"outputPath“的值。如果它设置为“dist/ your name”,尝试将其更改为"dist/",然后重新部署,然后对站点执行硬刷新(Ctrl+F5)。
发布于 2019-09-22 16:31:17
我解决了这个问题,只需运行npm cache clear -f,然后刷新浏览器。
希望这能有所帮助!
https://stackoverflow.com/questions/56906153
复制相似问题