#CSS tailwind styles appear when running dev but not build
14 messages · Page 1 of 1 (latest)
It sounds like you're importing a global.css file? How are you importing it?
in the layout.astro file ---
import "../styles/global.css";
also tried inside the header tag with <link rel="stylesheet" href="/styles/global.css">
wait... I'm trying to decipher what exactly is going on and a few things are running through my mind. When you build..... are you just opening index.html? Because that isn't going to work. npx serve dist will run the astro app
i do npm run preview
Hi @rare hedge!
Are you able to reproduce this in a shareable project? If not, could you share any relevant code from your configs?
Also, could you share your network tab? It should show whether the css files are 404ing, not being requested, etc.
Hi @latent marten here are my project files and the network tab from the preview
dropbox is a bit of a pain to download from (node_modules shouldn't really be uploaded because of size), but I managed to download. the weird thing is, after building again, I don't see the same issue. does this issue occur if you rebuild the project?
also, randomly. noticed you have tailwind installed. this is an unrelated package to tailwindcss, so you can uninstall this
thank you, I've deleted the dist folder and rebuild multiple times and it keeps happening to me 🙈 My goal is to upload the files to a web hosting plan in hostinger
can you try running npm install to reinstall node_modules?
just to make sure you're installed packages are the same
thank you @latent marten I uninstalled and installed node, tailwindcss and npm and it worked!!