Fixing empty NextJS CSS on production builds
July 2025
1 min read
This is a weird one, but while redesigning this page and upgrading to Tailwind 4 + NextJS 15, I had an issue where the CSS was empty on production builds.
It works fine with both local dev-mode and when building locally.
Solution
This is a hacky workaround, but it works ¯\_(ツ)_/¯
- Create an empty CSS file:
touch dummy.css
- Import it at the top of the
globals.css
file:
@import './dummy.css';
@import 'tailwindcss';