Disallowed MIME type (“text/html”) error - Angular Github pages

家住魔仙堡 提交于 2020-06-01 02:42:10

问题


I just deployed an Angular 8 project to my Github repository but nothing gets displayed on the Github page but I see an error on the browser console.

On Firefox the error says:

Loading module from “https://theotherspace.illiteratibooksandcoffee.com/theotherspace/runtime-es2015.27965c48d77c449cb93c.js” was blocked because of a disallowed MIME type (“text/html”).

and on Chrome:

Failed to load resource: the server responded with a status of 404 ()

Below are the screenshots:


回答1:


I had the similar issue as I was using Github pages from a different repository (than the parent github.io repo).

By changing the base href to the current directory solved the issue.

Earlier

<base href="/">

Change to

<base href="./">

I referred to https://github.com/angular/angular/issues/30835 until I arrived at this solution.



来源:https://stackoverflow.com/questions/59047455/disallowed-mime-type-text-html-error-angular-github-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!