Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported Tailwind class - tailwind.json is empty #156

Open
kehinde-elelu opened this issue Feb 28, 2022 · 12 comments
Open

Unsupported Tailwind class - tailwind.json is empty #156

kehinde-elelu opened this issue Feb 28, 2022 · 12 comments

Comments

@kehinde-elelu
Copy link

I am using tailwind version 4.2.0, and after following the instruction for installation.

My config file has been properly set-up

My tailwind.json is still empty {}.

@ciruz
Copy link

ciruz commented Feb 28, 2022

Had the same problem:

image

I fixed it by setting the content option in my tailwind.config.js and run the command yarn dev:tailwind to watch for changes.

@BassJonathan
Copy link

BassJonathan commented Mar 1, 2022

Had the same issue. I followed @ciruz instructions and added changed the content option in the tailwind.config.js file to content: ['./**/*.{html,js}']. After running npm run dev:tailwind I had some other errors like Error: Failed to parse declaration "textDecorationLine: overline". I tried to delete the classes but with npm run dev:tailwind the css-file gets updated. To avoid that, I added "fix:tailwind": "tailwind-rn" to the scripts in the package.json file and after running npm run fix:tailwind everythig is now working. This is only a temporary fix but works for me at the moment. In addition, the settings in the content option are not efficient at all. When working with bigger react native projects, that should be changed.

@CTOverton
Copy link

@BassJonathan I used content: ['./src/**/*.{js,jsx,ts,tsx}'], for my react native code and this seemed to work without the additional issues you had.

@Desolate1998
Copy link

Spent hours trying to fix this, but still nothing. Everything says Unsupported Tailwind class which I try.
My tailwind.config.js looks like this
`module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {},
},
plugins: [],

}

but when I run the dev:tailwind command, I get the following.

[0] warn - The content option in your Tailwind CSS configuration is missing or empty.
[0] warn - Configure your content sources or your generated CSS will be missing styles.
[0] warn - https://tailwindcss.com/docs/content-configuration
`

@asharma-dev
Copy link

Hello everyone, Those who are having the above issues.
I checked this docs https://tailwindcss.com/docs/content-configuration

Actually, So far from the above messages, I have no src directory.
In my case, it is just App.js, screens folder, components folder.
So I just changed content property to very specific as mentioned in the docs.

content: [
'App.js',
'./screens//*.{html,js}',
'./components/
/*.{html,js}'
]

also in the another terminal I have hit the command yarn dev:tailwind

hope this will resolve the issue!

@asharma-dev
Copy link

Had the same problem:

image

I fixed it by setting the content option in my tailwind.config.js and run the command yarn dev:tailwind to watch for changes.

target specific files in the content property will resolve the issue.
Please have a look at my answer above.

catalinmiron added a commit to catalinmiron/setup-tailwind-rn that referenced this issue Mar 23, 2022
This will fix the issue where `tailwind-rn` is not found. It is going to close: 
- vadimdemedes/tailwind-rn#156
- vadimdemedes/tailwind-rn#150
- vadimdemedes/tailwind-rn#152
@developer-ghahremani
Copy link

@BassJonathan I used content: ['./src/**/*.{js,jsx,ts,tsx}'], for my react native code and this seemed to work without the additional issues you had.

thanks dude, you survived me

@naveen1337
Copy link

naveen1337 commented Mar 29, 2022

module.exports = {
  content: ['./src/**/*.{js,jsx,ts,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
  corePlugins: require('tailwind-rn/unsupported-core-plugins'),
};

it worked !

@Noble-Shiva
Copy link

@CTOverton, Thanks a ton!

@AElisee
Copy link

AElisee commented Oct 24, 2022

hello, I followed the advice of each of you but I still have the error.

📍 All my folders are at the root of my project:

components
App.js
...

📍 Here is the content of my tailwind.config.js file:

module.exports = {
content: ["./components/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
corePlugins: require("tailwind-rn/unsupported-core-plugins"),
};

📍 I also notice that tailwind.css and tailwind.json are empty

@jhiin
Copy link

jhiin commented Nov 1, 2022

Then, if you use yarn just type:

yarn run dev:tailwind

or with npm

npm run dev:tailwind

@mashwishi
Copy link

up for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests