所以这是我第一次使用 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>)
Run Code Online (Sandbox Code Playgroud)
这是我的 index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
body {...
Run Code Online (Sandbox Code Playgroud)
我在 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();
Run Code Online (Sandbox Code Playgroud)