You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use css_splitter gem to break up the large combined CSS file for a Rails app. Unfortunately, something is not right as I'm running into the circular dependency issue regarding require_tree and require_self that should have disappeared post version 0.4.0. Any help is greatly appreciated.
Here's how to replicate the issue
Created a fresh rails 4.1.6 app
added to Gemfile
gem 'css_splitter'
added to application.css
foo { width: 100; }
created application_spilt2.css
/*
*= require 'application'
*/
added to initializers/assets.rb
Rails.application.config.assets.precompile += %w( application_split2.css )
$ rake assets:precompile
Sprockets::CircularDependencyError: /home/jkolen/Splitter/sp1/app/assets/stylesheets/application.css has already been required
/usr/local/rvm/gems/ruby-2.1.2@splitter_test/gems/sprockets-2.12.4/lib/sprockets/base.rb:392:in circular_call_protection' /usr/local/rvm/gems/ruby-2.1.2@splitter_test/gems/sprockets-2.12.4/lib/sprockets/base.rb:373:inbuild_asset'
....
I don't know if it's a red herring, but tracing through sprockets I noticed that the bundle option starts off true for application.css and then changes to false which leads to the thrown exception.
Here are the gem versions in the bundle:
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.3
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.1.6
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.6
Using rack 1.5.5
Using rack-test 0.6.3
Using actionpack 4.1.6
Using mime-types 2.99
Using mail 2.6.3
Using actionmailer 4.1.6
Using activemodel 4.1.6
Using arel 5.0.1.20140414130214
Using activerecord 4.1.6
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.1.6
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.11.2
Using tilt 1.4.1
Using sprockets 2.12.4
Using css_splitter 0.4.4
Using jbuilder 2.4.0
Using jquery-rails 3.1.4
Using libv8 3.16.14.13
Using bundler 1.6.2
Using sprockets-rails 2.3.3
Using rails 4.1.6
Using rdoc 4.2.1
Using ref 2.0.0
Using sass 3.2.19
Using sass-rails 4.0.5
Using sdoc 0.4.1
Using spring 1.6.1
Using sqlite3 1.3.11
Using therubyracer 0.12.2
Using turbolinks 2.5.3
Using uglifier 2.7.2
The text was updated successfully, but these errors were encountered:
I went ahead and followed a suggestion to remove the 'require_tree .' and added 'require' statements for each file. A bit of a nuisance, but it worked.
I'm trying to use css_splitter gem to break up the large combined CSS file for a Rails app. Unfortunately, something is not right as I'm running into the circular dependency issue regarding require_tree and require_self that should have disappeared post version 0.4.0. Any help is greatly appreciated.
Here's how to replicate the issue
Created a fresh rails 4.1.6 app
added to Gemfile
gem 'css_splitter'
added to application.css
created application_spilt2.css
added to initializers/assets.rb
Rails.application.config.assets.precompile += %w( application_split2.css )
I don't know if it's a red herring, but tracing through sprockets I noticed that the bundle option starts off true for application.css and then changes to false which leads to the thrown exception.
Here are the gem versions in the bundle:
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.3
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.1.6
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.6
Using rack 1.5.5
Using rack-test 0.6.3
Using actionpack 4.1.6
Using mime-types 2.99
Using mail 2.6.3
Using actionmailer 4.1.6
Using activemodel 4.1.6
Using arel 5.0.1.20140414130214
Using activerecord 4.1.6
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.1.6
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.11.2
Using tilt 1.4.1
Using sprockets 2.12.4
Using css_splitter 0.4.4
Using jbuilder 2.4.0
Using jquery-rails 3.1.4
Using libv8 3.16.14.13
Using bundler 1.6.2
Using sprockets-rails 2.3.3
Using rails 4.1.6
Using rdoc 4.2.1
Using ref 2.0.0
Using sass 3.2.19
Using sass-rails 4.0.5
Using sdoc 0.4.1
Using spring 1.6.1
Using sqlite3 1.3.11
Using therubyracer 0.12.2
Using turbolinks 2.5.3
Using uglifier 2.7.2
The text was updated successfully, but these errors were encountered: