skip to Main Content

I made the FB login page clone using Tailwind CSS and it works fine on my local machine, but when I deploy it to GitHub pages it shows me errors.

It worked well on Netlify but it’s giving errors on GitHub pages
here is the link
[these are the errors

2

Answers


  1. Your GitHub Pages site is at the URL https://gayatri-tech.github.io/FbLoginPage, in a subpath from the main host name, https://gayatri-tech.github.io/.

    In index.html, the CSS is referenced with the value /src/output.css which resolve to https://gayatri-tech.github.io/src/output.css. However, the file from your repository would be located at https://gayatri-tech.github.io/FbLoginPage/src/output.css, hence the 404 not found error.

    To resolve this, you could consider making the path reference relative by removing the first slash (/):

    <link rel="stylesheet" href="src/output.css" />
    

    The same resolution for the favicon reference:

    <link rel="icon" type="image/x-icon" href="fb_icon.png" />
    
    Login or Signup to reply.
  2. Can you try changing your pathing for these lines?

    index.html file

        <link rel="icon" type="image/x-icon" href="/fb_icon.png" />
        <link rel="stylesheet" href="/src/output.css" />
    

    TO

        <link rel="icon" type="image/x-icon" href="fb_icon.png" />
        <link rel="stylesheet" href="src/output.css" />
    

    package.json

    "build": "npx tailwindcss -i ./src/input.css -o ./src/output.css --watch"
    

    TO

    "build": "npx tailwindcss -i src/input.css -o src/output.css --watch"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search