问题
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