question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tailwindcss v3.0.5 is not picking up changes unless I change tailwind.config.js file

See original GitHub issue

What version of Tailwind CSS are you using?

v3.0.5

What build tool (or framework if it abstracts the build tool) are you using?

“postcss”: “^8.4.5”

What version of Node.js are you using?

v16.6.2

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

{
  "name": "tw2",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-service": "~4.5.0",
    "autoprefixer": "^10.4.0",
    "less": "^3.0.4",
    "less-loader": "^5.0.0",
    "postcss": "^8.4.5",
    "tailwindcss": "^3.0.5",
    "vue-template-compiler": "^2.6.11"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Describe your issue

Sometimes tailwind is not adding classes to final CSS when I’m adding them to my HTML files unless I edit the tailwind.config.js file, I usually comment and uncomment some line in that file and all of sudden I see the class has been added to the CSS file, I had this very same issue on my Next.js project as well.

I made a new reproduction repository and tested things there, it was all good and working. Not really sure why it’s not working on my own projects at some point. This may sound stupid but maybe tailwind is not picking up changes as the project get’s more complicated? I made this issue to know if anyone had some similar experience or not, so maybe someone can guide me on how to resolve this.

But if I change to the old version tailwindcss 2.2.19, there will be no problem

{
  "name": "tw2",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-service": "~4.5.0",
    "autoprefixer": "^10.4.0",
    "less": "^3.0.4",
    "less-loader": "^5.0.0",
    "postcss": "^8.4.5",
    "tailwindcss": "^2.2.19",
    "vue-template-compiler": "^2.6.11"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:27 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
christhofercommented, Dec 20, 2021

@kfsass

You can’t use dynamic class with concatenation like that.

https://tailwindcss.com/docs/content-configuration#class-detection-in-depth

image

4reactions
ThePeterMickcommented, Mar 22, 2022

Leaving this here in case it’ll help someone, I’m on a Mac and had a similar issue of changes not being picked up when using glob patterns:

Updating my postcss-cli from v8 to "postcss-cli": "^9.1.0" has resolved the issues for me 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - Tailwind CSS
A guide to configuring and customizing your Tailwind installation. Because Tailwind is a framework for building bespoke user interfaces, it has been designed ......
Read more >
Customizing Tailwind CSS using tailwind.config.js file - YouTube
Customizing tailwind Css using config file is as easy as updating the extend key. In this video, we will find out how and...
Read more >
Tailwind CSS Tutorial #5 - Tailwind Config - YouTube
Hey gang, in this tailwind css tutorial we'lltake a look at how we can customize our tailwind setup using a tailwind config file....
Read more >
Tailwind CSS classes are not making any changes in the ...
As you can see, the terminal is throwing a warning. Tailwind is not detecting your html files. Go to your tailwind.config.js and change...
Read more >
tailwindcss | Yarn - Package Manager
Use absolute paths when resolving changed files for resilience against working directory changes (#9032) ; Fix ring color utility generation when using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found