Skip to content

Latest tailwindcss and @tailwindcss/vite packages don't compile DaisyUI styles in Nuxt 3 Layers architecture #17648

@serhii-chernenko

Description

@serhii-chernenko

What version of Tailwind CSS are you using?

For example: v4.1.3

What build tool (or framework if it abstracts the build tool) are you using?

  • nuxt: 3.16.2
  • vite: 6.2.6
  • daisyui: 5.0.18
  • tailwindcss: 4.1.3
  • @tailwindcss/vite: 4.1.3

What version of Node.js are you using?

  • Node: 20
  • Bun: 1.2.9

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

Related repository:
https://github.com/serhii-chernenko/daisyui-issue

Describe your issue

In combination of Nuxt 3 Layers architecture, DaisyUI library, and upgrading Tailwind CSS I have the issue described below.

I also created the same issue to the DaisyUI and Nuxt repos:

But honestly, I'm not sure to which one it's really related. It'd be nice to involve Tailwind, Nuxt, Vite, and Daisy together, to find a root cause of this.

Steps to reproduce

Clone repo and install packages

git clone [email protected]:serhii-chernenko/daisyui-issue.git
bun install

Verify the installed versions related to tailwind

bun pm ls --all | grep tailwindcss
├── ...
├── @tailwindcss/[email protected]
├── [email protected]

Run a single Nuxt 3 application

cd src/layers/ui
bun run dev

Open http://localhost:3000

Expected result (buttons do nothing, it's just UI):
image

Deployed version is available here:
https://daisyui-issue-ui-playground.pages.dev

Run the end application in Nuxt 3 Layers architecture

cd ../../../
bun run build:app # it's necessary to generate the `wrangler.json` file
bun run dev:app

Open http://localhost:3000

Expected result (DaisyUI styles completely broken but Tailwind's styles work as expected):
image

Deployed version is available here:
https://daisyui-issue.pages.dev

Downgrade tailwindcss and @tailwindcss/vite to 4.0.3

Add to the root package.json file the next content:

"overrides": {
  "@tailwindcss/vite": "4.0.3",
  "tailwindcss": "4.0.3"
}

Or just switch to the branch:

git checkout fix/downgraded-tailwind-and-tailwind-vite-versions

PR is available here:
serhii-chernenko/daisyui-issue#1

Reinstall packages:

bun install

Verify packages again:

bun pm ls --all | grep tailwindcss
├── ...
├── @tailwindcss/[email protected]
├── [email protected]

Run the end application in Nuxt 3 Layers architecture again

bun run build:app # it's necessary to generate the `wrangler.json` file
bun run dev:app

Open http://localhost:3000

Expected result (DaisyUI styles work as expected):
image

Deployed version is available here:
https://preview.daisyui-issue.pages.dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions