Deploying React app with gh-pages

Hello.

So I’m trying to host my react App on GitHub pages with no luck.
I’m using yarn. Also using the default git bash (into my app’s root folder).

  1. Created the repo, then opened a bash terminal.
  2. “git remote add origin ssh-key” - WORKED
  3. “yarn add gh-pages” - WORKED - Weird part is that it took really long and only 1 new dependency added.
    added “homepage”: “https://ipwnturkeys.github.io/monsters-rolodex/”, to my package.json and
    “predeploy”: “yarn build”,
    “deploy”: “gh-pages -d build”
    to scripts.
  4. “yarn build”
    This is what I get:
$ yarn build
warning ..\..\..\package.json: No license field
$ react-scripts build
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  41.84 KB         build\static\js\2.4058bf1b.chunk.js
  1.64 KB          build\static\js\3.7d037c68.chunk.js
  1.18 KB (-13 B)  build\static\js\runtime-main.ef0a02fd.js
  932 B            build\static\js\main.b7b89312.chunk.js
  636 B            build\static\css\main.09b6c5a5.chunk.css

The project was built assuming it is hosted at /monsters-rolodex/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

$ gh-pages -d build
Invalid URL: http:git@github.com:Ipwnturkeys/monsters-rolodex.git
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Can you please help me figure this out?

Well from the link http:git@github.com:Ipwnturkeys/monsters-rolodex.git it is clear that that is invalid! The question is where it came from.

Without knowing the internals of the Pages CLI or CreateReactApp, I would say maybe check your git remote? It could have that link in which case this would be an easy fix: choose between SSH or HTTPS.