2023-11-27
2779
#react
Nelson Michael
127590
Nov 27, 2023 ⋅ 9 min read

Deploying React apps to GitHub Pages

Nelson Michael Nelson Michael is a frontend developer from Nigeria. When he's not meddling with CSS, he spends his time writing, sharing what he knows, and playing games.

Recent posts:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 ⋅ 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 ⋅ 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 ⋅ 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 ⋅ 5 min read
View all posts

14 Replies to "Deploying React apps to GitHub Pages"

  1. “gh-pages-d build”, there is a space in -d. if you would not add space you can get message that “‘gh-pages-d’ is not recognized as an internal or external command,
    operable program or batch file. ”
    should be like this
    “deploy”: “gh-pages -d build”

  2. Thank you for putting everything very well. I could easily go through the steps and got the deploying done. A big thank you

  3. Hi Michael, thank for posting this. I’m getting an error near the beginning.
    npm install gh-pages –save-dev

    Unsupported engine {
    npm WARN EBADENGINE package: ‘@csstools/[email protected]’,
    npm WARN EBADENGINE required: { node: ‘^14 || ^16 || >=18’ },
    npm WARN EBADENGINE current: { node: ‘v17.9.1’, npm: ‘8.11.0’ }

    I think this is connected to problems I’m having using the command line to manage my repository on github… but maybe I fixed that and this is a new problem…?

    Also, I’d like to subscribe to your blog, but I’m not sure what logrocket is and how to subscribe without paying a membership fee.

  4. When I try this, I end up with an empty page that just says “This site is open source. Improve this page.”

    I looked at the `artifact.zip` file that the ci built, and it appears to have created this index.html with just that content in it at the top level.

    My project runs just fine locally with `npm run start` for example.

    Any idea why this would happen?

    1. In my case I had forgot to add the homepage property in the package.json.

      “In the package.json file, add a homepage property that follows this structure: http://{github-username}.github.io/{repo-name}.”

Leave a Reply