-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind 4 does not work with react-router v7 framework mode #15237
Comments
I too am currently running into this error. Node Version: v21.6.2 {
"name": "dabzsite",
"private": true,
"type": "module",
"scripts": {
"build": "react-router build",
"dev": "react-router dev",
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc --build --noEmit"
},
"dependencies": {
"@react-router/node": "^7.0.1",
"@react-router/serve": "^7.0.1",
"@szhsin/react-menu": "^4.2.3",
"@tailwindcss/vite": "4.0.0-beta.3",
"@types/luaparse": "^0.2.12",
"framer-motion": "^11.12.0",
"gray-matter": "^4.0.3",
"isbot": "^5.1.17",
"luaparse": "^0.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-markdown": "^9.0.1",
"react-router": "^7.0.1",
"react-syntax-highlighter": "^15.6.1"
},
"devDependencies": {
"@react-router/dev": "^7.0.1",
"@types/node": "^20",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-syntax-highlighter": "^15.5.13",
"tailwindcss": "4.0.0-beta.3",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"vite-tsconfig-paths": "^5.1.2"
}
}
that said file only has the |
Similar here, I just updated both dependencies: tailwindcss and the vite plugin and I am getting the same issue:
|
I would like to note, if you build your css file using tailwind's cli tool, and use the outputted css file, react router builds just fine. |
After a bit of digging around I've noticed that it fails only with the Also what I've noticed after looking at the source Code because the strack trace locally complains about P.generate, I'd guess it originates from here: |
@philipp-spiess thank you for looking into this, I've pretty please asked the react router core team to take a look at this issue to see if maybe they could pinpoint the issue as well so we can all get along and enjoy our styling experience! |
With the thanks of the glorious @rossipedia we've managed to get it sorted it seems, after his investigation it seems as though it wasn't just a react-router thing but rather a |
Alright the fix has been merged and it'll be in the next beta release. Appreciate it @AlemTuzlak (and @rossipedia) 👍 |
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:
forge42dev/base-stack#14
Steps to reproduce:
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:
with
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 {
.The text was updated successfully, but these errors were encountered: