Webpacker Deployment Issue Rails 6
I had this same problem and noticed several templates/tutorials for adding Tailwind CSS to Rails specify adding to application.html.erb
:
<%= stylesheet_pack_tag 'stylesheets', media: 'all', 'data-turbolinks-track': 'reload' %>
while others specify:
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
Not a webpack expert, but doing some reading convinced me that the name in the stylesheet_pack_tag
helper is what webpack will look to bundle (from your \app\javascript\packs folder) but then is also the stylesheet name bundled by webpack (from your \public\packs\css folder) that your layout is looking for. It's really confusing, but I guess this is the convention over configuration thing. It also jives with the error being thrown above. If you rename your tag so it's application
it should solve your error (at least it seemed to work for me). Maybe the stylesheets
name is relevant for an older rails version?