vechai / vechaiui

A set of high-quality accessible React UI components with the built-in dark mode using Tailwind CSS. Pre-designed headless ui and radix-ui.

Home Page:https://www.vechaiui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: PostCSS plugin tailwindcss requires PostCSS 8.

samzhangjy opened this issue · comments

Hi. As in issue #22, I tried to install tailwindcss library. However, when I run the project, it gives me an error saying that tailwindcss requires PostCSS 8. But PostCSS 8 doesn't support React, yet: https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users#create-react-app

BTW, I have installed craco and replaced the scripts in package.json to craco as in the tailwindcss offical docs. Are there any workarounds for this? Thanks!

My package.json:

{
  "name": "stcomix",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@craco/craco": "^6.2.0",
    "@tailwindcss/forms": "^0.3.3",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@vechaiui/core": "^0.3.7",
    "@vechaiui/react": "^0.1.9",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "autoprefixer": "^10.2.6",
    "postcss": "^8.3.5",
    "tailwindcss": "^2.2.4"
  }
}

Oops... Sorry. I found the solution in the tailwind docs: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build. This has been fixed by that workaround... Thank you!