Skip to content

[v4] Errors on build when using other post-css plugins (works fine in dev) #17408

@WouterDeGeringel

Description

@WouterDeGeringel

The issue

When using other postcss plugins (in this case postcss-mixin and postcss-nested) everything works fine with vite's dev server. But when building the order of the plugins is not respected, causing issues and even a build error in the case of postcss-mixin. I get the same then not using the Vite config but a postcss config file. I would expect the dev and build would produce the same results and since Tailwind 4 is just a postcss plugin it would respect the plugin order.

Env

System:
    OS: macOS 15.3
    CPU: (12) arm64 Apple M2 Max
    Memory: 141.72 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.10.0 - /opt/homebrew/bin/node
    npm: 10.9.2 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 134.0.6998.89
    Safari: 18.3
  npmPackages:
    @tailwindcss/postcss:  4.0.17
    postcss-mixins: 11.0.3
    postcss-nested": 7.0.2
    vite: 6.2.3

Issue project repo

https://github.com/WouterDeGeringel/tailwind4-postcss-plugins-issue-on-build

Reproduction steps

  • run: npm install
  • run: npm run dev
  • Everthing works fine (hover on "X" will turn it red
  • run: npm run build
  • You'll see an error (error during build: ... Undefined mixin icon

Metadata

Metadata

Assignees

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