FileNotFound followed by CircularDependency #133
Comments
It looks like you are trying to use the old sprockets 1 require syntax. Second, beta.11 has been revoked from rubygems, you shouldn't be using it. I'd suggest using rails/master and sprockets/master as it has the latest bug fixes for the circular dependency stuff. |
I'll pull sprockets/master and see if I have better luck. Stuck with Rails 3.0 right now though. Thanks. On Jul 24, 2011, at 1:13 PM, joshreply@reply.github.com wrote:
|
I'm getting this same issue in a standalone Rack app I'm working on. Not sure if its a bug or if I'm just missing something :) I'm making something similar to Serve or StaticMatic, but using sprockets for assets. Any time sass or js compilation throws an error (whether its a sprockets error or a sass error directly) once fixed, Sprockets hangs on a CircularDependency error until I stop and restart the server. Here is a gist of the Rack::Builder setup, and the class I'm using to serve assets. I subclassed Sprockets::Environment so I could just configure it when initialized. Everything works perfectly outside of that. It seems like on error, Sprockets doesn't clear out its existing cache etc. and considers the file already included when it continues. I'm wondering if some kind of As a random side note, that gist may help anyone trying to use this outside of Rails :) Its actually quite easy to do. I haven't tried pre-compiling yet, but seems pretty straightforward. |
Doing a quick test... calling I overrode def javascript_exception_response(exception)
expire_index!
super(exception)
end
def css_exception_response(exception)
expire_index!
super(exception)
end I'm thinking this is probably a good solution, since the existing file index would certainly change next request, when the user fixes the error. |
I also got this error, and it's certainly confusing, since the actual problem is the original Have tried brentkirby's suggestion, and that works for me too. |
Schneems/cleanup resolver
Using v2.0.0.beta.11 with Rails 3.0
I have my javascripts in the following folder structure:
In setting up the Rack app, I've used the following:
When I attempt to
//= require <views/staff_members/show>
from application.js, I end up withSprockets::FileNotFound: couldn't find file '<views/staff_members/show>'\n (in /Users/crimsonfox/RailsApps/gatescan/app/javascripts/application.js:1)
All subsequent attempts to load application.js result in
Sprockets::CircularDependencyError: /Users/crimsonfox/RailsApps/gatescan/app/javascripts/application.js has already been required
until I restart my Rails server process.Rails caching is current turned off.
I've noticed that I can call
resolve
withininitialize
, passing it 'views/staff_members/show' and it will return the correct path to the file. I'm not sure why the file can't be found viarequire <views/staff_members/show>
.To summarize, on a fresh restart I get FileNotFound and refreshes result in CircularDependencyError until a restart. However, if I use the double-quote method of
require
, I get the expected result. I'm fine with using the work-around. I'd just like to know if there's a bug in the other method, or if I've missed something critical in my understanding of how it works.The text was updated successfully, but these errors were encountered: