igrigorik / closure-sprockets

Sprockets processor for Google's Closure tools
http://www.igvita.com/2011/08/16/rails-3-asset-pipeline-google-closure/
54 stars 11 forks source link

Dependencies script triggers infinite loop #1

Closed samaretti closed 13 years ago

samaretti commented 13 years ago

I'm seeing Closure's base.js doing an import of deps.js. This, in turn, seems to trigger a loop, whereby deps.js is being imported infinitely. I can get around it by setting CLOSURE_NO_DEPS to true.

Wondering if you had encountered this? I used your readme example on a bare Rails project.

igrigorik commented 13 years ago

Hmm, that's an odd one - nope, haven't stumbled into that one myself. What do your main rails configs look like? (gist?)

sutherland commented 13 years ago

It's a fresh Rails app. All of the configs are default, except the Gemfile which I trimmed down.

I've published the app here: https://github.com/sutherland/blog

(FYI: Same guy, different Github account)

igrigorik commented 13 years ago

Hmm, well not sure if there really is a clean fix for this. If we also include the closure-compiler gem then it should work transparently when it processes the results of the pipeline (when set to advanced optimization). Otherwise, I think we just have to add the solution you highlighted:

    <script type="text/javascript">
      var CLOSURE_NO_DEPS = true;
    </script>

That should go in application.html.erb above the javascript_include tag.

igrigorik commented 13 years ago

Added a note about this in readme, closing.