I\'m using Rails 5.2.0 and Webpacker gem to deploy a Vue application.
The show.html.erb file is very simple:
I had similar problem in Rails 5.2 + webpack Vue. All was good in development, but not working in production. After hours of investigating I found the reason. It was in this recommendation from webpaker gem docs.
Adding this
Rails.application.config.content_security_policy do |policy|
if Rails.env.development?
policy.script_src :self, :https, :unsafe_eval
else
policy.script_src :self, :https
end
end
brokes production. Removing else
part - fixing the situation.
Chrome silently ignoring this. Firefox shows warnings.