Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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();
like image 874
Ihsan Fajar Ramadhan Avatar asked Dec 11 '20 07:12

Ihsan Fajar Ramadhan


2 Answers

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

like image 80
Or Assayag Avatar answered Nov 03 '22 00:11

Or Assayag


Update NodeJS using nvm by following the steps from this link: https://docs.microsoft.com/en-us/windows/nodejs/setup-on-windows

Make sure you have uninstalled the previous node_modules folder from your project.

Follow these steps

Install RimRaf:
npm install rimraf -g

And in the project folder delete the node_modules folder with:
rimraf node_modules

Reference: How to Delete node_modules - Deep Nested Folder in Windows

like image 37
Joshua Poddoku Avatar answered Nov 03 '22 00:11

Joshua Poddoku