cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.89k stars 216 forks source link

curl occasionally tries to get lib.js as libjs.js - 0.7.3 #163

Closed jcollum closed 11 years ago

jcollum commented 11 years ago
    script
      curl = {
            baseUrl: "/js",
            paths: {
              "jquery"  : "//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.0/jquery.min.js",
              "fizz"      : "fizz.js",
              "index"   : "index.js",
              "bacon"   : "bacon.js",
              "baz"     : "//baz.org/baz.js",
              "buzz"    : "buzz.js"
            }
          };
    script(src='/js/curl.js')
    script
      window.require = curl;
      curl(['js!jquery'])
        .next(['js!bacon', 'js!fizz!order', 'js!index!order', 'js!baz', 'js!buzz'])
        .then(function success(bacon, fizz, index){
              console.log("scripts loaded");
              },
            function(){
              alert("a module failed to load");
             });

Got a prototype page that I'm building that uses bacon.js to track events. For some reason curl will ocassionally try to get bacon.js as baconjs.js, which results in 404. I've added in the debug module (thanks for making that very easy to do) and will update if it happens again. Typically the issue will go away a couple of 404s later.

Windows7, if that matters.

jcollum commented 11 years ago

This might be related to Bacon failing to load and some code on the client side that is looking for window.Bacon. I'll update this ticket once I've figured out why Bacon is failing to load.

unscriptable commented 11 years ago

Thanks for the detailed bug report. I've never seen curl do anything like this before so I'll be very interested to hear what you find. -- John

unscriptable commented 11 years ago

Can I assume this issue is closed, too? If not, please update it and reopen it. Thanks!