Home > Enterprise >  How to fix Error 404 in deploying react app to GitHub pages
How to fix Error 404 in deploying react app to GitHub pages

Time:11-05

I'm trying to deploy my react app to GitHub pages, but I get error 404, although it works well in the localhost.

CodePudding user response:

try to add index.html in root of your repository like
AK-ram/Todoist/index.html
for more information click this link

CodePudding user response:

your index.html is

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAkFBMVEXkQzL////  fnkQTDkPy3jNR/kPizjOyjjNyLjOSXjMxziMRn98vH//fzvnJX3zsr1xcH52dbiLhT64 HwoZr76efnWUvoZlrysazzubTlSzvnXlHtj4fqdmzrgXj76ObpbmLxpqDlTz/yrafuk4v0vbn53Nr2ycXnYVTsh37oYFPqcmjlTT3iKgzrfHLukokgVjmEAAAI UlEQVR4nO2c53rqOhBFwSqu9E7oLeFwwn3/t7sm5YRizxZg2ZBv1v/EEta2RjNbUyoxDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDPMgCCGKHoJV3EAuhoH3ayepm5Na5ETTuev/yjlK9WdT/iQaKV30cDJHeIt1 YfWLpBFDylbXL/tlE947Qa/aKnK5qRTPqfSD9yiB5YRUr00LuZ3wNn/iinGAhwkzu/Ayy8QoxtUndQJlud 0eO7FxnuLwV4xFoVPcL7EGkC/MfoqYUovGG6AD9pPHWQqpvVCExwLp94gjIYkwKMqQ fOAIXwUsNzG8zC593fiWv1Afzi0bBE4fe n0FBVh64uOTVOMpmN/rUD3v/EwEuHtiAQpf9ytAgCvvmQUYjpAAl KpBbhrgfnVFvkI0EooKILuK5hfax/mdFbaNjNXgvC9JZifs/Jzi7LLm17GWSCtoAD7OkcBxgfS9SLDkFAGsw2YXy3frNPhyO20vYzWjFCLOhRgzpnDz6RCZ9zM4LHCDedgfpVqfgL84jttUnu5 9utvS0S4MDN/4z0kxjq3xcACyzAxlsRIdpR6itahTfvHEL9RQLsTIopT5wk91o37hzCVX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CO71m9x6lSE/pII7B0VeV0LvQr9D12gatccV4Ck3 k1atNnroRDB9X4T4DV5OAyuwJzSf7r /4eWueY7R87txzPCID34Re7txzMjDuQM/CZO/u3HM8QgTT/Is/ /DXxBmg3MrkY9NvHOkRrITYvtfpwZOiWQOxQbn/4FfiISAzlwI 3ZuAjkCm0/boVTORbV/98uOth9BauHriS/7AV oZvd1XJZnZH3DZ4c6Xre9eVhhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmGYXPkf4ZWQNFlwIPMAAAAASUVORK5CYII=" type="image/x-icon">
    <meta charset="utf-8" />
    <!-- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> -->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Web site created using create-react-app"
    />
    <!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
    <title>todoist</title>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root" class="overflow-hidden"></div>
  </body>
</html>

for testing update this in your index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAkFBMVEXkQzL////  fnkQTDkPy3jNR/kPizjOyjjNyLjOSXjMxziMRn98vH//fzvnJX3zsr1xcH52dbiLhT64 HwoZr76efnWUvoZlrysazzubTlSzvnXlHtj4fqdmzrgXj76ObpbmLxpqDlTz/yrafuk4v0vbn53Nr2ycXnYVTsh37oYFPqcmjlTT3iKgzrfHLukokgVjmEAAAI UlEQVR4nO2c53rqOhBFwSqu9E7oLeFwwn3/t7sm5YRizxZg2ZBv1v/EEta2RjNbUyoxDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDPMgCCGKHoJV3EAuhoH3ayepm5Na5ETTuev/yjlK9WdT/iQaKV30cDJHeIt1 YfWLpBFDylbXL/tlE947Qa/aKnK5qRTPqf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38SX4/5rbT1a0Gav5uN5TX5y3qAlh9CeUoo8AMQCRGav6a6AUvfPbjC9r62KgQCr dudS6d1izta45iYvQrq/Xi6o/fps2waBoeRRmEh6FnM4ozIjHwiJl6TTDr83MZFVHa138QXc5CkcOyVXQxIiDvrf69YULoJE/3gxoJtEiPruWkvGal6sLFQoWfAUloN2KwfUCxA7DUp8r7BB2lpBoOWMq4PzV7tAtyW56SPEfTl0kn9/0/J80ZaOsRbqBCfQKlgXXVj5DqyD7nO0qoRJmavbVFuy3PAQBPPAm4AzV5Xuf/sAluJX6QANOj/X36ExkJH4PcRjY5TAAblqU2P9JrkjsB k8bsW1OxAHFfk6JvpF0iFbwWW   K9/3QrgDPmr7cYObBK1Bu9qHboYHbj/u6yVyAmEeu/ /CO71m9x6lSE/pII7B0VeV0LvQr9D12gatccV4Ck3 k1atNnroRDB9X4T4DV5OAyuwJzSf7r /4eWueY7R87txzPCID34Re7txzMjDuQM/CZO/u3HM8QgTT/Is/ /DXxBmg3MrkY9NvHOkRrITYvtfpwZOiWQOxQbn/4FfiISAzlwI 3ZuAjkCm0/boVTORbV/98uOth9BauHriS/7AV oZvd1XJZnZH3DZ4c6Xre9eVhhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmEYhmGYXPkf4ZWQNFlwIPMAAAAASUVORK5CYII=" type="image/x-icon">
    <meta charset="utf-8" />
    <!-- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> -->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Web site created using create-react-app"
    />
    <!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
    <title>todoist</title>
  </head>
  <body>
    <h1> this is a test page</h1>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root" class="overflow-hidden"></div>

  </body>
</html>

visit your site at https://ak-ram.github.io/Todoist/
if this work you can add your css, js etc...

  • Related