skip to Main Content

I’m a total newbie and have relied heavily on ChatGPT to assist me in getting this far. I have a production build of working app that I can run on a local server. I’m pretty sure I’ve followed all the directions I found on deploying it on GitHub Pages. When I try to access the site I get a blank page with these errors shown in the first image. Errors

Which makes no sense to me because each of those files are in the correct location and the paths good, as shown in the second image. File paths

When I launch the app from GitHub, this line in the root index.html file redirects to the index.html in the "www" directory. This part seems to work, but then it errors out when trying to open the 4 .js files used to launch the app. (See first image).

<meta http-equiv="refresh" content="0;url=https://dolanbs1959.github.io/TRM-DailyGeoTracker/www/index.html" />

With my first ng build, Angular had the angular.json architecture output path set to www, so I went with it. And the default base href in the index.html was "./". I changed this to match the path in my remote repo master. I think all the files are in the correct branch structure, but, like I began with, I’m new.

When I run ng deploy it appears to complete the build, but then errors out with:

.nojekyll file could not be created. ENOENT: no such file or directory, open
‘…DocumentsVisual Studio CodeGettingStartedAngularBuild1wwwbrowser.nojekyll’

I think the basehref is correct. Here’s the bash command I’m trying to use:

$ ng deploy --base-href=https://appdev.intelli-bridge.net/TRM-DailyGeoTracker/

When I manually create the nojekyll file, either in the root directory or in a new "browser" directory, they don’t get assimilated in the build.

I’ve tried modifying the package.json file to get the .nojekyll file created after the build and before the deploy. No luck.

I haven’t been able to locate any help on this issue, probably because I’m not looking where I need to, or not asking the right questions. But if anyone can help, please chime in.

And today I’ve learned the without the subdomain the app launches and functions as designed. But not with the subdomain. And the subdomain is verified and meets all the criteria.

Thanks,
Barry

2

Answers


  1. Chosen as BEST ANSWER

    Solved the issue. For Angular app, using a custom domain requires the baseHref to be set to "/". The subdomain subdomainname.[user_name].github.io will resolve to the root repo and the app will launch. I had to take quite the journey around a bunch of testing in difference fixes and suggestions, but it turns out that the defaults were nearly correct. The only thing I really had to change was to remove the "." from the baseHref, and set the angular.json output to "docs" instead of "www".


  2. Ensure that the baseHref is set correctly in your Angular app. In your angular.json file, make sure that the baseHref is set to the correct path when deploying to GitHub Pages.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search