Getting Expo Web To Work with Custom Domain on Github Pages

It took several days to work through the issues so I wanted to put this out here as a help to anyone who has this same issue in the future.

I followed the instructions in the docs to deploy my website to github pages: https://docs.expo.io/versions/latest/guides/deploying-websites/#creating-a-build

This worked and I could view my webapp on https://.github.io/

However, when I attempted to use a custom domain in the github settings I continued to get a 404 error with issues related to the Manifest.json.

The problem is that you need to set a baseHref which you can do so by updating package.json with the following:

  "homepage": ""

Hopefully, this helps someone in the future.

2 Likes

Hmm, I’m facing the same bug but that didn’t solve it for me…

It actually works fine with the normal .github.io domain for me, but after I re-deploy, the custom domain gets taken out of my settings in Github. It seems to be the same issue as this: Deploying seems to overwrite custom domain · Issue #213 · tschaub/gh-pages · GitHub

The solution appears to be to publish a CNAME file in the web-build branch whenever expo web deploys. Not sure how to do that, though.

Maybe you could help here too? [WEB] Deploy Amplify and use in <div id="root"/> instead of iFrame

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.