Search code examples
cssreactjstypescripttailwind-css

Unknown at rule @tailwind css(unknownAtRules)


So this is my first time using Typescript and Tailwind. I already followed tailwind guide for create-react-app but when I try to run npm start I got this error:

./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>)

this is my index.css

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

body {...

I got warning in index.css Unknown at rule @tailwind css(unknownAtRules)

and this is my 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();

Solution

  • This is strange. Try to update your Node.js to the latest current stable version and try again.