Tailwind CSS Not Working After Deployment to GitHub Pages #79050
Replies: 3 comments 5 replies
-
Hi It is not just Tailwind, but any static assets that are missing in your output. ![]() How are you deploying to GitHub pages exactly? |
Beta Was this translation helpful? Give feedback.
-
Oi, eu estou respondendo sua discussão só para dizer que gostei muito da sua página que você fez com Tailwind CSS :) |
Beta Was this translation helpful? Give feedback.
-
Solution: Set basePath and assetPrefix in next.config.js module.exports = nextConfig; Also Clean Up & Rebuild rm -rf .next out const nextConfig = { module.exports = nextConfig; Set basePath and assetPrefix Rebuild with npm run build && npm run export Push the /out folder content to GitHub Pages (usually gh-pages branch or /docs) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Description:
I am facing an issue where Tailwind CSS works fine locally during development but does not load properly when the project is deployed to GitHub Pages.
Steps to Reproduce:
npm install
to install dependencies.npm run dev
to start the development server.http://localhost:3000
).npm run build
followed bynpm run export
(or following the deployment steps).Actual Behavior:
Tailwind CSS does not load on GitHub Pages, though it works locally.
Repository:
https://github.com/ComputeAce/find-my-house-react-js
Additional Information:
next.config.js
file for static export (output: 'export'
).Any help or suggestions would be appreciated! Thank you.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions