My repository: https://github.com/Alperenkarslix/website
My website: https://alperenkarslix.github.io/website/
I can not figure out why my GitHub pages
can’t load any of my source files. The files I want to load are in the src folder
. Everything works as it should on localhost. It only loads index.html
which is a white blank screen, I don’t have anything coded in this file. I’ve seen a few similar posts about this issue but have not found any solution.
I have installed the gh-pages module
through npm
and done “npm run deploy”; this created my gh-pages branch.
I’ve updated my package.json
with the needed information.
I hosted this website before on Github Pages
at this domain with no issues. It appears that Github pages
and the process has changed since then and I can’t get it to run now.
I added this code in package.json:
"homepage" : "https://alperenkarslix.github.io/",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
and I have a gh-pages branch
in my repository
I use this command in terminal
npm run deploy
, which works and it say Published however I still can’t see my pages.
3
Answers
please try replacing the homepage key in the package.json from
to
here website refers to your app name.
Solution
Need to define your base on Vite.
Or can use relative default path – i prefer to it for Github Page –
After deploy, open your Github Pages static application:
https://<github-username>.github.io/<repository-name>/
More information
"homepage": "https://alperenkarslix.github.io/website", // Your URL
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d out" // Change ‘build’ to ‘out’ if you’re using Next.js
}