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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Oliver, thanks so much for the feedback.
What version of Ruby are you running?
I'm experiencing the same issue on Ruby 2.7.3.
same issue on Ruby 3.0.1
Edit: I think I was wrong below. Here's what worked: try setting
compile: falseinwebpacker.ymland commentingmode: 'jit',intailwind.config.js. I can runbin/webpack-dev-server,rails s, andguardat 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-serverhandles 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',intailwind.config.jsseemed to fix it too, before I stopped runningguard.You can also just not run
bin/webpack-dev-server--rails swill still compile stuff for you and then you can havebundle exec guardin the bg if you prefer that.