Open jcrate opened 10 years ago
Here is a minimalistic project demonstrating this bug:
https://github.com/lulalala/turbo-sprocket-issue
Normally this project will asset-precompile just fine.
If turbo-sprocket-rails3 is installed, a Sprockets::CircularDependencyError will be raised. This happens if I @import a file and later require that file too.
This is quite common because nested requires will cause the same error too.
I can require a gem, which only @imports "jquery.ui.datepicker"
, which will require jquery.ui.core
.
Then if I require jquery.ui.spinner
myself, it will also try to require jquery.ui.core
, and cause the exception.
In my Rails 3.2.x project that includes both active_scaffold and jquery-ui-rails gems, a CircularDependencyError is thrown when compiling asses with turbo-sprockets-rails3, while assets are compiled successfully without turbo-sprockets-rails3. This is reproducible in a sample project.
gemfile:
application.js:
application.css:
top few lines of stack trace:
Assets compile successfully with turbo-sprockets-rails3 if I remove the inclusion of jquery.ui.all from application.css, so if I don't need any parts of jquery-ui that active_scaffold doesn't include, that may be a possible workaround. However, the default (slow) compilation handles this scenario without errors, so it's possible that other combinations of gems with assets could trigger the same error.