DEV Community

Discussion on: Getting started with Rails 6.1, TailwindCSS JIT, Webpacker & PostCSS 8

Collapse
 
davidteren profile image
David Teren

Hey Oliver, thanks so much for the feedback.
What version of Ruby are you running?

Collapse
 
alistairtweed profile image
Alistair Tweed

I'm experiencing the same issue on Ruby 2.7.3.

Thread Thread
 
scotti_jack profile image
Jack Scotti

same issue on Ruby 3.0.1

Thread Thread
 
xertrov profile image
Max Kaye • Edited

Edit: I think I was wrong below. Here's what worked: try setting compile: false in webpacker.yml and commenting mode: 'jit', in tailwind.config.js. I can run bin/webpack-dev-server, rails s, and guard at the same time now without issue or compile-refresh loops.


This started happening to me after I got tailwind working. Are you running some live-reloading tool? (e.g., I was running bundle exec guard.) If so, try not running that. bin/webpack-dev-server handles livereloading when running, it seems.

NB: webpack-dev-server would almost always compile things twice for me (now) but stops after that (until I make another change).

I also noticed that commenting mode: 'jit', in tailwind.config.js seemed to fix it too, before I stopped running guard.

You can also just not run bin/webpack-dev-server -- rails s will still compile stuff for you and then you can have bundle exec guard in the bg if you prefer that.