i have a project on my laptop using tailwindcss cli, it goes right on my laptop, but when i upload it to github pages it wont work like it never have css or anything, i allraedy reupload it but still have the same result.
photos on Github pages
photos on my laptop
link github :
https://github.com/dimas-web-dotcom/cloning-web-streaming/
how can i fix it, it almost 2 days now
2
Answers
The repo you included seems to be missing a lot of things that could help us help you. For instance the
package.json
file is missing all the scripts that could point us into the direction of how you are building things for prod vs development. Also, we usually don’t commit ournode_modules
.In any case, the issue seems to be related to the URL of your CSS.
Your HTML file points to the CSS like this
<link href="/dist/output.css" rel="stylesheet" />
but your site is located in a subfolderexample.com/mysite/index.html
and that makes the lookup for the CSS to be made in the root of the domain (example.com/dist/output.css
) instead of the subfolder (example.com/mysite/dist/output.css
).So, changing it to a relative path should do the trick:
If what Elvis Adomnica said haven’t worked with you, yet it should, check those links below.
TailwindCSS working on local computer but not when deployed to GH-Pages
https://github.com/tailwindlabs/tailwindcss/discussions/12024