-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
What version of Tailwind CSS are you using?
4.1.11
What build tool (or framework if it abstracts the build tool) are you using?
Next.js 15.4.3, npm 10.8.1
What version of Node.js are you using?
v22.4.0
What browser are you using?
Chrome
What operating system are you using?
Windows
Reproduction URL
Since this is a upgrade issue I don't have a reproduction URL.
Describe your issue
I upgraded my project from v3 to v4 using the official upgrade documentation. Everything went fairly okay, no need to dive too deep into it.
The actual issue I have (which caused things to not work properly) is that the content
field from tailwind.config.ts
was not properly migrated to my globals.css
file. I'm having a monorepo, but the example would give you more clarity:
// root/apps/web/tailwind.config.ts
const config: Config = {
darkMode: ['class'],
content: [
// more here, it's a big and complex monorepo, but the example will make it clear
'./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}',
],
Since I'm using Next.js, tailwind.config.ts
is inside root/apps/web/
(my web app), which has a tailwind dependency. And it makes sense, since heroui is installed inside root/apps/web/node_modules
.
Then, after the upgrade, I get this:
/* root/apps/web/src/ui/styles/globals.css */
@source '../../../../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
It took me some time to figure out why this wasn't working π
All of this makes sense, as the dir seems relative to root. That's where I executed the upgrade script from, because I am having multiple tailwind related apps/packages. But the result does not take in consideration where the actual tailwind config was, so that it can figure out the appropriate location.
I'm sorry if this is confusing or there's something else off, but it's pretty hard for me to reproduce the same issue again π
Thanks!