hosting gh-pages on custom domain, white empty page

后端 未结 3 1777
南方客
南方客 2021-01-15 01:44

im new to coding and need some help. I made a react project (using create-react-app), and the website has been running on my gh-pages branch

(heres my repo: https:/

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-15 02:23

    Had this same problem. I believe this issue is caused when you use the PUBLIC_URL environment variable, like so:

    %PUBLIC_URL%/main.css

    which works for the github.io site but causes path problems in the custom domain, which adds the variable in front of the path like in Simcha's example. So, we need to manually remove every instance of the this variable (process.env.PUBLIC_URL) each time we build for gh-pages.

提交回复
热议问题