未知规则@tailwindcss(unknownAtRules)

所以这是我第一次使用 Typescript 和 Tailwind。我已经按照针对 create-react-app 的顺风指南进行操作,但是当我尝试运行时npm start出现此错误:

./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
TypeError: Object.entries(...).flatMap is not a function
    at Array.forEach (<anonymous>)

这是我的 index.css

@tailwind base;
@tailwind components; 
@tailwind utilities;

body {...

我在 index.css 中收到警告 Unknown at rule @tailwind css(unknownAtRules)

这是我的 index.js

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
// import App from './App';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
  <React.StrictMode>
    <div className="px-4 py-2 bg-green-500 text-white font-semibold rounded-lg hover:bg-green-700">tombol</div>
  </React.StrictMode>,
  document.getElementById('root')
);

reportWebVitals();

回答

这很奇怪。尝试将您的 Node.js 更新到最新的当前稳定版本,然后重试。


以上是未知规则@tailwindcss(unknownAtRules)的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>