Closed pbyrne closed 3 years ago
The Hotwire
module does not implement eager_load!
. That makes sense, there is nothing to eager load.
Deleting the line
config.eager_load_namespaces << Hotwire
would be the most exact thing to do. If you are not eager loadable, just do not configure yourself as eager loadable.
Alternatively, we could apply this patch just in case in the future you'd like to use AS::Autoload
macros somewhere in this module. Personally, I am not a big fan of "just in case"s, but that is @dhh's choice :).
Let's just remove. Don't like just in case either 👍
Fixed via beddd7b873bcab386d4bc60353652b4343f3c558 and 5b8a4e1ec0a15ba86109e72acd68fd1f31338eb4
Because:
The following error happened when deploying a Rails 6.1 app to staging, which had
config.eager_load = true
, but which didn't happen in local development:Solution:
ActiveSupport::Autoload
, like theturbo-rails
gem doeseager_load!
method, app moves past this errorThis is effectively the same as https://github.com/hotwired/stimulus-rails/pull/7.