I tried all the above solutions but could not resolve it.
At last, I downgraded my Tailwind to v3 using:
npm install -D tailwindcss@3 postcss autoprefixer