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

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

Closed
fguillen opened this issue Dec 7, 2016 · 11 comments
Closed

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

fguillen opened this issue Dec 7, 2016 · 11 comments

Comments

@fguillen
Copy link

fguillen commented Dec 7, 2016

I am having this warning in my Sinatra App:

/Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet.rb:2: warning: loading in progress, circular require considered harmful - /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet/compat.rb
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:4:in  `<main>'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:4:in  `select'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:15:in  `block in <main>'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:15:in  `require'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/test/ab_testi_wrapper_test.rb:1:in  `<top (required)>'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/test/ab_testi_wrapper_test.rb:1:in  `require_relative'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/test/test_helper.rb:7:in  `<top (required)>'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/test/test_helper.rb:7:in  `require_relative'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/app/publisher_plugin.rb:10:in  `<top (required)>'
	from /Users/fguillen/Development/Dalia/IT/Web/Product/PublisherPlugin/app/publisher_plugin.rb:10:in  `require'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet/compat.rb:1:in  `<top (required)>'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet/compat.rb:1:in  `require'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet.rb:2:in  `<top (required)>'
	from /Users/fguillen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/redcarpet-3.3.4/lib/redcarpet.rb:2:in  `require'

More info:

$ bundle list
Gems included by the bundle:
  * ab_testi_client (0.1.0 2e11b00)
  * activemodel (5.0.0.1)
  * activerecord (5.0.0.1)
  * activesupport (5.0.0.1)
  * airbrussh (1.1.1)
  * arel (7.1.4)
  * backports (3.6.8)
  * bundler (1.12.5)
  * capistrano (3.6.1)
  * capistrano-bundler (1.2.0)
  * capistrano-harrow (0.5.3)
  * capistrano-rbenv (2.0.4 e056efc)
  * concurrent-ruby (1.0.2)
  * curb (0.9.3)
  * daemons (1.2.4)
  * dalia_api_campaign_platform (0.1.3 1c8a99e)
  * dalia_api_panel_hub (0.0.7 bba2b9a)
  * eventmachine (1.2.0.1)
  * git-version-bump (0.15.1)
  * httparty (0.14.0)
  * i18n (0.7.0)
  * json (2.0.2)
  * macaddr (1.7.1)
  * metaclass (0.0.4)
  * mini_graphite (0.1.1 353ab48)
  * minitest (5.9.1)
  * mocha (1.2.1)
  * multi_json (1.12.1)
  * multi_xml (0.5.5)
  * mysql2 (0.3.21)
  * net-scp (1.2.1)
  * net-ssh (3.2.0)
  * rack (1.6.4)
  * rack-contrib (1.4.0)
  * rack-protection (1.5.3)
  * rack-test (0.6.3)
  * rake (11.3.0)
  * recursive-open-struct (1.0.1)
  * redcarpet (3.3.4)
  * rollbar (2.13.3)
  * sinatra (1.4.7)
  * sinatra-activerecord (2.0.11)
  * sinatra-contrib (1.4.7)
  * sshkit (1.11.4)
  * systemu (2.6.5)
  * thin (1.7.0)
  * thread_safe (0.3.5)
  * tilt (2.0.5)
  * tzinfo (1.2.2)
  * uuid (2.3.8)

For my records this is the PP project

@robin850
Copy link
Collaborator

Hi @fguillen,

Sorry for the late answer but would it be possible to give a sample script that reproduce this issue please ?

I don't think this is a Redcarpet issue as it's possible to do require 'redcarpet/compat' without having your warning message but anyway ; maybe there's something which is not so well documented on our side.

@fguillen
Copy link
Author

fguillen commented Jan 31, 2017

Hi @robin850 I found the same issue with another gem:

I created a small project that reproduces the issue:

I still don't know where the issue is, looks like it is not regarding to a specific gem.

@robin850
Copy link
Collaborator

Actually this was reproducible running ruby -w -e 'require "redcarpet"' there was really a simple circular dependency on our side but this is now fixed on master and will be fixed in the next release of Redcarpet. Thank you very much @fguillen ! ❤️

@fguillen
Copy link
Author

:)

@jules2689
Copy link

Hey :) Is there any chance of a release for redcarpet so we can get rid of this warning? 🙏

@jensljungblad
Copy link

Getting this too!

@pasnox
Copy link

pasnox commented Sep 1, 2018

Still present in release 3.4.0

 pasnox  ~  ruby -w -e 'require "redcarpet"'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/2.5.0/gems/redcarpet-3.4.0/lib/redcarpet.rb
from -e:1:in <main>' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in require'
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in require'
from /usr/lib/ruby/gems/2.5.0/gems/redcarpet-3.4.0/lib/redcarpet.rb:2:in <top (required)>' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require'
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /usr/lib/ruby/gems/2.5.0/gems/redcarpet-3.4.0/lib/redcarpet/compat.rb:1:in <top (required)>'
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require'

@pyrmont
Copy link

pyrmont commented Jun 26, 2019

@robin850 Just pinging to request a release of Redcarpet with this fix.

@robin850
Copy link
Collaborator

@pyrmont : I'll try to do my best to cut a release as soon as possible (a few days hopefully).

@pyrmont
Copy link

pyrmont commented Jun 28, 2019

@robin850 That would be awesome! Thank you! :)

@robin850
Copy link
Collaborator

Sorry it too so long folks but 3.5.0 is out with the fix attached to this issue. Have a nice day! :-)

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

No branches or pull requests

6 participants