Skip to content

Tailwind 4 does not work with react-router v7 framework mode #15237

@AlemTuzlak

Description

@AlemTuzlak

What version of Tailwind CSS are you using?

For example: v4.0.0-beta.3

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

For example: react-router v7

What version of Node.js are you using?

For example: v22.0.0

What browser are you using?

For example: Chrome

What operating system are you using?

For example: Windows

Reproduction URL

You can find the reproduction on the PR below:
forge-42/base-stack#14

Steps to reproduce:

  • clone the repro and checkout the PR
  • run npm run build
  • it fails

Describe your issue

The build script for tailwind doesn't work with react-router framework mode, I'm guessing it's also the case with Remix.run as the root issue seems the same. What I've noticed is that if you replace the following in package.json:

  "build": "react-router build"

with

  "build": "vite build"

the build goes through, I'm guessing there is something in the react-router build pipeline that breaks the tailwind compilation, the error i get is: [@tailwindcss/vite:generate:build] Missing opening {.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions