3

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:

firefox error Chrome error

Prakash M.
  • 479
  • 8
  • 26
felixo
  • 1,453
  • 6
  • 33
  • 60

2 Answers2

12

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.

Prakash M.
  • 479
  • 8
  • 26
1

I was working on a nextjs + typescript project and had the exactly same problem.
I solved it by adding an empty .nojekyll file to the target folder (same as github pages deployment settings).

I've been searching for days until I arrived at this solution. Hope it will help someone who is also in trouble.

The source I found was in Japanese, but this English one has more details. https://til.simonwillison.net/github/github-pages

julia817
  • 11
  • 2