webpacker with rails 6 compiles assets in development but doesn't work in production

Created on 10 Jul 2019  路  2Comments  路  Source: rails/webpacker

I'm using the built in generator on a fresh rails 6.0.0.rc1 project and webpack-dev-server works well in development. However, assets fail to work in production resulting in 404s and 422s.

I've tried rake webpacker:compile to no avail :(

Most helpful comment

my bad, needed to enable config.public_file_server.enabled = true in config/production.rb

All 2 comments

my bad, needed to enable config.public_file_server.enabled = true in config/production.rb

Many thanks!!! yesterday I spent tons of hours about this issue. It's crazy, any tutorial warns to do this change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suhomozgy-andrey picture suhomozgy-andrey  路  3Comments

towry picture towry  路  3Comments

vtno picture vtno  路  3Comments

christianrojas picture christianrojas  路  3Comments

amandapouget picture amandapouget  路  3Comments