Open BenSturmfels opened 2 years ago
This issue is most obvious on the "Donate Button" page where the donate form will fail to load in production because it's calling back to "http://localhost:5000" (which of course isn't your production site). Get's confusing if you also happen to have a development site running on localhost, hah!
When I build the assets in production mode on
main
, I get an error unless I add something something likeconfig.action_mailer.default_url_options = {host: 'https://example.com'}
toconfig/environments/production.rb
. This URL is then hard-coded into the built JS for the donation form among other things. If you don't specifyRAILS_ENV=production
, you get thedefault_url_options
fromconfig/environments/development.rb
, which ishttp://localhost:5000
and won't work at all in production.How is this intended to be set up for production? The full URL may be required for things like links in emails if you can't get them from the request, but probably isn't necessary for the JS since it knows where it was loaded from.
Here's the error I got while building the production JS: