Fixes circular dependency check failures #13

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Collaborator

mcolyer commented Sep 11, 2011

Previously, if you used the rails runner to prevent reloading the rails
server and you attempted to build the same bundled asset twice,
sprockets would fail with a circular dependency check error.

It turns out that sprockets caches bundled assets in memory and doesn't
clear it's circular dependency checking array, this commit goes in and
clears that array to prevent that check from failing.

Fixes circular dependency check failures
Previously, if you used the rails runner to prevent reloading the rails
server and you attempted to build the same bundled asset twice,
sprockets would fail with a circular dependency check error.

It turns out that sprockets caches bundled assets in memory and doesn't
clear it's circular dependency checking array, this commit goes in and
clears that array to prevent that check from failing.
Owner

dnagir commented Sep 12, 2011

It doesn't seem to happen on my side.
What do you do to reproduce it?

Collaborator

mcolyer commented Sep 15, 2011

If I have an asset in rails 3.1 that requires multiple coffeescripts and one of those coffeescripts has an error the build fails (like it's supposed to). However if I fix that error, when guard-rails-assets tries to build the asset a second time it fails with the circular dependency check. Without this fix the only way to get around it is to exit out of guard and start over again.

Owner

dnagir commented Sep 15, 2011

Ok. I'll merge it when I'll be at my dev machine.
Hope pointing the bundler to your Github repo won't be troublesome for now.

Collaborator

mcolyer commented Sep 15, 2011

Yep using bundler is fine for now.

Hi guys

I have this error that I post in stackoverflow with new sprockets 2.0

http://stackoverflow.com/questions/7462661/sprocketscirculardependencyerror-in-storeindex

Too some times show this error to change css.

SystemStackError in Store#index

Showing /home/ubuntu/Desktop/Depot/app/views/layouts/application.html.erb where line # raised:

stack level too deep
(in /home/ubuntu/Desktop/Depot/app/assets/stylesheets/application.css.scss~)
Extracted source (around line #):

Rails.root: /home/ubuntu/Desktop/Depot

Application Trace | Framework Trace | Full Trace

When I change the css properties, width, heigh, margin... some times el server doing DOWN! and when shut down show the log the next message:

Rendered store/index.html.erb within layouts/application (104.8ms)
Compiled application.css.scss~ (18ms) (pid 3575)
Compiled application.css.scss~ (17ms) (pid 3575)
Compiled application.css.scss~ (17ms) (pid 3575)
Compiled application.css.scss~ (19ms) (pid 3575)
Compiled application.css.scss~ (22ms) (pid 3575)
Compiled application.css.scss~ (11ms) (pid 3575)
Compiled application.css.scss~ (13ms) (pid 3575)
.
.
.
.
Completed 500 Internal Server Error in 9336ms

ActionView::Template::Error (stack level too deep
(in /home/ubuntu/Desktop/Depot/app/assets/stylesheets/application.css.scss~)):

Can you help me to fix this error.

Thank you :D

@dnagir dnagir closed this in 8faa2f4 Sep 20, 2011

Owner

dnagir commented Sep 20, 2011

@mcolyer there's much better fix to it. Check out the commit :)
I've released it as v 0.0.8.

Collaborator

mcolyer commented Sep 20, 2011

Indeed, thanks for spotting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment