问题
I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000.
I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs
I get the following error
I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked.
- I have commented out
<%= stylesheet_pack_tag %>
... didn't help - I have toggled
extract_css: true
in webpacker.yml file .... didn't help - I have run
heroku buildpacks:clear
heroku buildpacks:set heroku/nodejs
heroku buildpacks:add heroku/ruby
... didn't help
Does anyone have any idea what is going on?
My github repo is https://github.com/HundredBillion/enneagram
回答1:
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.
回答2:
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: false
compile: true
Try
./bin/setup
rails webpacker:clobber
rails 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
来源:https://stackoverflow.com/questions/59831329/rails-6-and-tailwind-css-does-not-deploy-to-heroku