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

Cannot eager load in Rails 6 from uninitialized constant ShopifyAPI::AdminVersions #913

Closed
ericotto opened this issue Apr 1, 2022 · 2 comments · Fixed by #927
Closed

Comments

@ericotto
Copy link

ericotto commented Apr 1, 2022

Issue summary

Application fails to start with eager loading in Rails 6.

Expected behavior

The library loads successfully when the application starts.

Actual behavior

The library fails to load when rails 6 eager loading if utilized:

`const_get’: uninitialized constant ShopifyAPI::AdminVersions (NameError)

Steps to reproduce the problem

  1. Start Rails 6 application with eager_load set to true

Logs

If applicable, enable the logs as described in the README, and paste the relevant portion here.

/usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get’: uninitialized constant ShopifyAPI::AdminVersions (NameError)
from /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget’
from /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget’
from /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load’
from /usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load’

Specifications

  • shopify_api version: Main Branch
@scart88
Copy link

scart88 commented Apr 8, 2022

+1
I'm getting the same error on Rails 7.
It breaks on rails console as well.

❯ rails c
Loading development environment (Rails 7.0.2.3)
[1] pry(main)> ShopifyAPI::AdminVersions
NameError: uninitialized constant ShopifyAPI::AdminVersions
Did you mean?  Administrate
from (pry):1:in `__pry__'
[2] pry(main)> 

@scart88
Copy link

scart88 commented Apr 8, 2022

@paulomarg I pushed a fix for this issue.
Could you please review it when you got some time?

Thank you very much!

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