Rails 6 and Tailwind CSS does not deploy to Heroku
I had the same problem with you but I tried this one and it worked for me.
Inside of config/webpacker.yml, you must set extract_css: true default is false.
Stumbled across this post while stuck on a similar problem, hopefully this info will help someone in the future.
I solved my issue within the package.json file by moving the "tailwindcss" reference from the devDependencies to the dependencies block.
{ "name": "app_name", "private": true, "dependencies": { "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.2.2", "jquery": "^3.5.1", "tailwindcss": "^1.2.0", // <--- Now here. "turbolinks": "^5.2.0" }, "version": "0.1.0", "devDependencies": { //<--- Was here. "webpack-dev-server": "^3.10.3" }}
I have a few suggestions for you, let me know which one (if any) work for you.
In webpacker.yml for all instances of the below options
check_yarn_integrity: falsecompile: true
Try
./bin/setuprails webpacker:clobberrails webpacker:compile
If none of the above work then perhaps one of these links will help: - https://github.com/tailwindcss/discuss/issues/4#issuecomment-341918136 - https://github.com/IcaliaLabs/tailwindcss-rails