#CSS tailwind styles appear when running dev but not build

14 messages · Page 1 of 1 (latest)

rare hedge
#

please help! I can't find why the styles won't export when running build. I don't see the global.css styles in the dist folder...

#

CSS tailwind styles appear when running dev but not build

obsidian pagoda
#

It sounds like you're importing a global.css file? How are you importing it?

rare hedge
#

in the layout.astro file ---

import "../styles/global.css";

also tried inside the header tag with <link rel="stylesheet" href="/styles/global.css">

obsidian pagoda
#

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

rare hedge
#

i do npm run preview

latent marten
#

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.

rare hedge
latent marten
#

also, randomly. noticed you have tailwind installed. this is an unrelated package to tailwindcss, so you can uninstall this

rare hedge
#

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

latent marten
#

just to make sure you're installed packages are the same

rare hedge
#

thank you @latent marten I uninstalled and installed node, tailwindcss and npm and it worked!!