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();
This is strange. Try to update your Node.js to the latest current stable version and try again.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With