-1

I am new at angular and trying to deploy it on Github Pages. I am not sure what I am doing wrong here because the app is not working. When I did inspect on the page I found below: enter image description here

Now when I clicked on one of these resource link I found that they are not accessible due to CORS origin. I am not sure how to fix this, I tried to see if on github is there any configuration which could be changes to fix this problem but found nothing so far. Please let me know if you have seen this problem before and have got around it. Thank You

Here is the project: https://github.com/EngrAshishKumar/angular_tic_tac_toe.git enter image description here

4
  • “I found that they are not accessible due to CORS origin” — How do you come to this conclusion when the error message is 404 Not Found?! You just got the URLs to them wrong. Commented Jul 22, 2023 at 7:51
  • Hi Quentin, so in the second screenshot if you see below 404 its mentioned strict-origin-when-cross-origin. And I tried changinf base href to different path as well but still didn't work. Commented Jul 22, 2023 at 15:37
  • That’s a request header, not an error message, and one that has nothing to do with CORS. developer.mozilla.org/en-US/docs/Web/HTTP/Headers/… Commented Jul 22, 2023 at 20:47
  • Aah that's what it is actually I was getting specific message earlier on console saying something like can't access due to CORS and I modified base href and started getting this error, so I thought it might have something to do with cross origin request to these resources. But anyways now I modified the index.html again to blank like <base href=""> and now it is working. Commented Jul 23, 2023 at 11:49

1 Answer 1

0

This problem is resolved now, I modified base href on index.html <base href=""> because my angular build files are in docs directory. Now I guess when we set the pages in github and make it point to /docs then that docs becomes the base path and unless we have build files stored in subdirectory inside this docs directory we don't need to specidy base-href. enter image description here

Below thread has more discussion over similar issue: 404 when Deploying Angular 6 app to github pages

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.