不允许的MIME类型("text/html")错误-Angular Github页面 [英] Disallowed MIME type (“text/html”) error - Angular Github pages

查看:172
本文介绍了不允许的MIME类型("text/html")错误-Angular Github页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的Github存储库中部署了一个Angular 8项目,但是Github页面上什么都没有显示,但是我在浏览器控制台上看到错误.

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.

在Firefox上,错误提示:

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).

和在Chrome上

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

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

以下是屏幕截图:

推荐答案

我遇到了与使用来自其他存储库(而不是父github.io存储库)的Github页面类似的问题.

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

通过将base href更改为当前目录可以解决此问题.

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

更早

<base href="/">

更改为

<base href="./">

我提到了 https://github.com/angular/angular/issues/30835直到我找到这个解决方案为止.

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

这篇关于不允许的MIME类型("text/html")错误-Angular Github页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆