Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Rozan-Mustafa opened this issue Sep 2, 2023 · 8 comments · Fixed by #297
Closed

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

Rozan-Mustafa opened this issue Sep 2, 2023 · 8 comments · Fixed by #297
Milestone

Comments

@Rozan-Mustafa
Copy link

ruby 3.2.2
rails 7.0.7

route_translator v14.0.0

@tagliala
Copy link
Collaborator

tagliala commented Sep 2, 2023

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 tagliala closed this as completed Sep 2, 2023
@navidemad
Copy link

@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

@tagliala
Copy link
Collaborator

tagliala commented Sep 3, 2023

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

@tagliala tagliala reopened this Sep 3, 2023
@tagliala
Copy link
Collaborator

tagliala commented Sep 3, 2023

I think I got the issue

@tagliala
Copy link
Collaborator

tagliala commented Sep 3, 2023

@navidemad replicated thanks, working on a fix.

It is related to the new initializer generator and to

config.eager_load_namespaces << RouteTranslator

@navidemad
Copy link

navidemad commented Sep 3, 2023

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.

tagliala added a commit that referenced this issue Sep 3, 2023
tagliala added a commit that referenced this issue Sep 3, 2023
While adding the new initializer generator, an unneeded railtie was
included by mistake

This commit removes the railtie

Fix #296
@tagliala
Copy link
Collaborator

tagliala commented Sep 3, 2023

14.0.1 released, sorry for the small inconvenience

@tagliala tagliala added this to the 14.0.1 milestone Sep 3, 2023
@navidemad
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants