[Solved] Tailwind content key is missing or empty

React JS Sharif Ahmed

Problem:

I was trying to use tailwind on my Js application. But I was getting a warning saying,

The content key is missing or empty. Please populate the content key as Tailwind generates utility on-demand based on the files that use them.

In this article, we are going to discuss the issue and the solution to it.


Solution:

Your Html must be linked to the content. For the time being, erase everything and link to the Html file. Feel free to add other files afterward. So update your code like this,

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

Thank you for reading the article. If you have any suggestions please comment below.