enriclluelles/route_translator

undefined method `eager_load!' for RouteTranslator:Module (NoMethodError)

Rozan-Mustafa opened this issue · 8 comments

ruby 3.2.2
rails 7.0.7

route_translator v14.0.0

Hi!

Thanks for being part of the Route Translator Community.

Debugging Route Translator issues is a time consuming task, please use a web browser to fill out our Bug Report template and provide as many information as you can.

For this specific report, it would be much better to include a reproducible test case.

@tagliala

Hello, firstly thanks for your gem it helps us a lot.

I got the same issue, we downgraded to < 14 for the moment.
I tried to make a reproducible case, but i didn't isolate the issue but it appears only in my CI, not when i'm running the test locally on my computer.

Run bin/rspec spec'

An error occurred while loading ./spec/components/back_link_component_spec.rb.
Failure/Error: require_relative "../config/environment"

NoMethodError:
  undefined method `eager_load!' for RouteTranslator:Module
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/application/finisher.rb:75:in `each'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/application/finisher.rb:75:in `block in <module:Finisher>'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/initializable.rb:32:in `instance_exec'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/initializable.rb:32:in `run'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/initializable.rb:61:in `block in run_initializers'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/initializable.rb:60:in `run_initializers'
./vendor/bundle/ruby/3.2.0/gems/railties-7.0.7.2/lib/rails/application.rb:372:in `initialize!'
./config/environment.rb:7:in `<top (required)>'
./spec/rails_helper.rb:5:in `require_relative'
./spec/rails_helper.rb:5:in `<top (required)>'
./spec/models/user_spec.rb:3:in `<top (required)>'

I do not have any matches for eager_load! in my project and neither in the gem when i opened it through bundle open route_translator

I got the same issue, we downgraded to < 14 for the moment.

Does it work with < 14?

Ok. If it works on localhost but does not work on CI, there could be some issues with the bundled gems there

I think I got the issue

@navidemad replicated thanks, working on a fix.

It is related to the new initializer generator and to

config.eager_load_namespaces << RouteTranslator

I got the same issue, we downgraded to < 14 for the moment.

Does it work with < 14?

Ok. If it works on localhost but does not work on CI, there could be some issues with the bundled gems there

Awesome, thanks for your quick reply.
Yes i confirm you, it happened only after we upgraded with your latest update.

14.0.1 released, sorry for the small inconvenience

Thanks for the patch, i tried the main branch version, and it's works perfectly 💯