Skip to content
New issue

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

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

Already on GitHub? # to your account

warning: loading in progress, circular require considered harmful #505

Open
brcarp opened this issue Jan 21, 2020 · 1 comment
Open

warning: loading in progress, circular require considered harmful #505

brcarp opened this issue Jan 21, 2020 · 1 comment

Comments

@brcarp
Copy link

brcarp commented Jan 21, 2020

gem 'dragonfly-s3_data_store'

$ grep dragonfly Gemfile
gem 'dragonfly-s3_data_store'
$ grep dragonfly Gemfile.lock
    dragonfly (1.1.4)
    dragonfly-s3_data_store (1.3.0)
      dragonfly (~> 1.0)
  dragonfly-s3_data_store
$ ruby -w -e 'require "dragonfly"'
/path/to/rubygems/core_ext/kernel_require.rb: warning: loading in progress, circular require considered harmful - /path/to/gems/dragonfly-1.1.4/lib/dragonfly.rb

Is this tied to dragonfly, this particular version, or some other dependency chain in the configuration? It would be helpful if others could comment as to its reproducibility.

@kolen
Copy link

kolen commented Feb 27, 2021

Reproducible when having only dragonfly (ruby -w thisscript.rb).

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'dragonfly', '1.3.0', require: false
end

require 'dragonfly'

This was introduced in dragonfly 1.0, reproducible in versions >= 1.0, not reproducible in <= 0.9.15.

For example, dragonfly.rb requires dragonfly/middleware:

require 'dragonfly/middleware'

And dragonfly/middleware.rb requires dragonfly again:

require 'dragonfly'

This happens for:

  • dragonfly -> dragonfly/app -> dragonfly/shell
  • dragonfly -> dragonfly/model -> dragonfly/model/class_methods
  • dragonfly -> dragonfly/middleware

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

No branches or pull requests

2 participants