7

This is my first time installing and running Tailwind CSS. I follow the instructions and did everything accordingly but then it started showing some warnings like below:

warn - The `content` options in your Tailwind CSS configration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing style.
warn - https://v3.tailwindcss.com/docs/content-configuration

enter image description here

Can you tell me why I am getting these warnings and anyway for me to fix them? As I am worried that my generated CSS will be missing styles So help is needed to fix it.

Also, can I keep the Tailwind CSS in watch mode?

1

5 Answers 5

1

enter image description here

Make sure you don't have repeated properties in your Tailwind config file. After upgrading from v2 to v3, Accidently I had put two content properties. Other than that make sure you have done migration properly.

framework guide: https://tailwindcss.com/docs/installation/framework-guides

upgrade guide: https://tailwindcss.com/docs/upgrade-guide

Sign up to request clarification or add additional context in comments.

Comments

1

This warning occurred because you did not use any of the tailwind classes, causing tailwind to suspect that the project config was not implemented correctly.

https://tailwindcss.com/docs/installation

Comments

1

If anyone ever encounters this error, I realized that I had both a tailwind.config.js and tailwind.config.ts in my repository at root level (I had forgotten to delete tailwind.config.js).

Deleting the redundant tailwind.config.js fixed it.

Comments

0

It's look like you dont have the tailwind config file. Take a look in your root folder if you have. If not you can create one by this command: npx tailwindcss init

Then the tailwind cli will create the tailwind.config.js file. It looks like:

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [],
}

https://tailwindcss.com/docs/installation

Comments

0

what i did personnally , i deleted the tailwind.config.js, and opened the terminal and paste these two lines:

npm install -D tailwindcss postcss autoprefixer

npx tailwindcss init -p

problem resolved

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.