next.jsdeploymenttailwind-cssvercel

Tailwind styles does not work in the production, Next.js and Vercel


Why are certain CSS styles not being applied to my Next.js 14.1.3 website deployed on Vercel, despite being present in the code and working locally? I've tried using use client but to no avail. Here's the deployed version and the repo for reference.

Deployed version enter image description here

Local version enter image description here

Deployed version console enter image description here


Solution

  • Yea had the same problem and going crazy to solve it, the thing is that in tailwind.config.ts there is one line like this

    "./components/**/*.{js,ts,jsx,tsx,mdx}",
    

    And probably you name the folder as Components, the sensitive case in local are omitted but in server is not, so tailwind is not applying some styles because can't find the folder