Updating maxFileSize in hyrax initializer doesn't change value in application js

23 views
Skip to first unread message

Kevin Bowrin

unread,
Mar 16, 2021, 6:17:27 PM3/16/21
to samvera-tech

We've updated the value in config/initializers/hyrax.rb but asset:precompile is still stubbornly using the old value. Any ideas?

Jeremy Friesen

unread,
Mar 17, 2021, 1:44:44 PM3/17/21
to samvera-tech
We talked a bit about this in today's Samvera Tech call.

Some thoughts we had was that if you run precompile using one environment then deploy using another.

To diagnosis anything more, I think we'd need to know more.  What environment (and where) are you running asset:precompile?  For those newly precompiled assets, have they changed?

Kevin Bowrin

unread,
Mar 17, 2021, 3:38:07 PM3/17/21
to samvera-tech
Thanks for bringing it up in the call, Jeremy.

I was able to fix this problem. The old value was stored in the sprockets cache directory in a .cache file (under tmp/cache/assets/sprockets). [thanks grep!] Deleting that directory and running assets:clobber then assets:precompile and restarting puma finally pushed the new value into the application js file.

I'm not a Rails dev, but I think this problem happened because Rails didn't know to regenerate Hyrax's app/assets/javascripts/hyrax/config.js.erb file using the new config values because that template hasn't actually changed. It would fall back to using the cached version instead.
Reply all
Reply to author
Forward
0 new messages