Search code examples
reactjsgithubgithub-pages

My react app does not seen in github pages like a code


I watched lots of videos, and I read lots of documentations, but I couldn't do this subject. Can you help me?

First of all, I have an react app on github, HERE:https://github.com/alper-efe-sahin/portfolio-v2 (It completed app)

I have 2 branch, first MASTER branch, and second GH-PAGES branch.

I created GH-PAGES using codes which are npm run build and npm run deploy. Also you can see my some package json codes here:

    "gh-pages": "^3.2.3",
    "deploy": "gh-pages -d build"
  "homepage": "https://github.com/alper-efe-sahin/portfolio-v2",

When I try to create github page, it shows my github page, note It's codes. (for instance, it shows react documents, not react codes, not html css etc.)

How can I show my codes like a good website ?


Solution

  • You have the wrong value set at the property homepage in package.json

    it should be https://alper-efe-sahin.github.io/portfolio-v2

    Also add the script "predeploy": "npm run build" alongside with deploy in scripts so when you run npm run deploy it also builds your app with npm first.

    source: The guide I followed for my cra