Ticket #2531587 (closed defect)
Reporter J. Shirley |
Opened: 12/13/11 Last modified: 05/10/12 Status: closed Type: defect Resolution: fixed |
Owner Dav Glass |
Target Release: 3.5.0 Priority: P2 (high) |
|---|---|---|---|
| Summary: | Loader will not load custom modules if combine: true | ||
| Description: | Loader will load dependencies, but not any custom module (regardless if it is in a group or a top level module) unless combine: false (or the custom module is also loaded through a combo service). I have a page setup with 3.5.0pr1 and 3.4.1 seeds, using the same code as presented that shows the issue clearly. |
||
| Type: | defect | Observed in Version: | 3.5.0pr1 |
| Component: | Loader | Severity: | S3 (normal) |
| Assigned To: | Dav Glass | Target Release: | 3.5.0 |
| Location: | Library Code | Priority: | P2 (high) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | http://j.shirley.im/tech/yui/issues/loader-test.html | ||
| Test Information: | |||
Change History
|
Posted: 12/13/11
|
|
Posted: 12/13/11
|
|
Posted: 12/14/11
|
|
Posted: 12/14/11
I've found an additional issue, but not sure exactly how related it is (so it may be a new ticket). If I take a working configuration and try to override the gallery, the gallery then will fail to load (this also was working in 3.4.1). In the example from the URL, if I simply add in something like the gallery definition below, no gallery modules will load:
I do this for testing my own gallery modules prior to a pull, since we have a QA cycle I can throw at them. I can't find any combination of combine: values that cause it to work. I can, however, list the individual gallery modules and the path (but that's not an option, as we heavily rely on the gallery). Thanks. |
|
Posted: 12/14/11
I've found that I must also have a top level `gallery` tag, which if I have that (depending upon configuration) may throw an error:
(Using yui.js, L6021 of combo). |
|
Posted: 12/14/11
J, can you please file that second issue as a separate ticket so I can track it. They are two different issues and need to be tracked as two. Thanks |
|
Posted: 12/14/11
Can you test against this patch before I push it to CDN for use? Simply add it directly after your seed file and it should "just work" |
|
Posted: 12/14/11
I'll post the second ticket shortly, for now that doesn't seem to work: I modified the other fiddle, I think this is what you meant should work: |
|
Posted: 12/14/11
Um, it helps if you close the script tag :) |
|
Posted: 12/14/11
Shocking! Thanks :) |
|
Posted: 12/15/11
Did that patch also fix your gallery loading issue as well? |
|
Posted: 12/15/11
Yeah -- that ended up being the same thing (the other issue I saw was also present in 3.4.1 and trying to figure out exactly what's goin on). Thanks! |
|
Posted: 12/21/11
It tried adding the patch script as indicated and my custom module would not load, but with or without the patch included it works fine with 3.4.1. This was also the case when all combo loading is turned off, in the Firebug console I see a "No modules resolved.." information message from the loader, and then the errors start. My YUI call is a bit convoluted because there is dynamic module generation going on, but the code looks like this:
<code> var mods = {}, c = PWC.buildYconf(); mods['pwc-form-' + modName] = {fullpath: '/app/js/' + modName}; c.modules = mods; YUI(c).use('node', 'pwc-form-' + modName, function (Y) { ... } </code> |
|
Posted: 12/21/11
Sorry, that code should be:
|
|
Posted: 12/21/11
I just added an attachment, sample.html, from my testing trying to isolate the problem, with combine: true the patch will work on that particular page (though not with my other code) but the attached file is configured with combine: false and the module 'node' does not get attached to Y, resulting in an error. (You will see a "Loaded" panel in the middle of the page if it works.) |
|
Posted: 01/3/12
@Jamison Can you try this patch? |
|
Posted: 01/3/12
Patch for #2531587 updated |
|
Posted: 01/3/12
|
|
Posted: 01/3/12
The updated gist does fix the sample.html that I attached to this ticket, but my app is still breaking if I update to 3.5pr1 + that gist from 3.4.1. (I have tested with my locally hosted 3.4.1, 3.4.1 on the CDN and 3.5.0pr1 on the CDN, only 3.5.0pr1 on the CDN does not work). This code does not seem to trigger any request to the URL "/app/js/xlogin" on the hosting server: ).use('xlogin', function() { doSomething(); }); </script> This tells me that the modules are never loaded but I do not quite understand why the request to "use" a module that is not available does not cause an immediate error given that no attempt is being made to add the module. Is there a syntax change or something that is causing the modules config to be incorrect that I am not finding? I'll try to put something stand-alone together that can demonstrate the issue better shortly. |
|
Posted: 01/3/12
Sorry, my code had a triple-brace in it.. making the wikisyntax break. I have attached an updated copy of sample.html. When I load this page no attempt is made to access the URL the module to load is supposed to be located at but the other modules load just fine and the script included runs. I would expect an attempt to be made to load the module and for that attempt to fail and the use callback to never get executed. |
|
Posted: 01/4/12
I'm not seeing that behavior in master or using PR1 with the latest loader:
Using this version of Loader: And this example: |
|
Posted: 01/4/12
I did not work for me if I updated my attached page to use your loader and pr1 the same as what is in your example. What I get now is the loader actually generating a bad combo request, I get a 400 back from the yahoo server. It turns out that I can avoid that problem if I remove the references to the overlay and panel modules. After some fooling around I found the minimal request that can reproduce the combo loader problem for pr1: Now I changed my app, but there it is still not working. I will trim my app's generated page down and attach anther page the reproduces the problem shortly. |
|
Posted: 01/4/12
|
|
Posted: 01/4/12
I updated the attached sample.html, the ticket does not seem to indicate that when I actually update it. (Next time I will rename it, I expected it to be added not updated.) |
|
Posted: 01/4/12
Ref #2531587 - Added better error handling for 404's The complete method now handles failures and timeouts |
|
Posted: 01/4/12
@Jamison -- I tried your example again and it worked for me: However, the issue may be in your module data. Can you give me a stripped down version of what `/app/js/xlogin` looks like so I can see if it's loading or not. |
|
Posted: 01/5/12
The module xlogin does not really exist, I wrote up the sample file to demonstrate the problem with a module that does not exist on purpose, using the Firefox Web Console this is what I see if I download the attached file and open it in Firefox 8.0.1: ) @ file:///C:/Users/Jamison/AppData/Local/Temp/sample.html:11 As I think you can see, there is no attempt to load xlogin. Now, if that is because I am loading the file off disk instead of a server and there is a security issue I'd understand that - but there is no error. If I pop the file up on my local web server, I get the same result: ) @ http://192.168.137.181:8765/sample.html:11 |
|
Posted: 01/5/12
Too bad you can't preview a comment before posting it.. let me try that again. ) @ http://192.168.137.181:8765/sample.html:11 </nowiki> |
|
Posted: 01/5/12
Sorry, one more time!
|
|
Posted: 01/5/12
I just pushed an update that will fix this, the diff between what you had and what I has was I had combine set to false. Once I set it back to true, it broke for me too.. |
|
Posted: 01/5/12
Ref #2531587 - Missed a module not defined inside a group The resolve method does two passes on modules, once for |
|
Posted: 01/5/12
|
|
Posted: 01/5/12
Fixes #2531626, #2531637, ref #2531587 Added support for comboSep and maxURLLength for groups. |
|
Posted: 01/5/12
Refs #2531626, #2531637, #2531587 - Added more loader tests Loader tests for comboSep, maxURLLength in groups. |
|
Posted: 01/5/12
Is this the loader I should be using to re-test? http://_Sraw.github.com/davglass/yui3/master/build/loader/loader.js If so, then I get a new error:
(Firefox 8.0.1) If not, what should I use to re-test? |
|
Posted: 01/6/12
@Jamison - Same test page? I don't see that error & I can't replicate it. I can't even see how that error would be thrown, please add a repro case and I will get it patched up. |
|
Posted: 01/6/12
|
|
Posted: 01/6/12
|
|
Posted: 01/6/12
The attached file reproduces for me, I just clicked on the download link ( http://yuilibrary.com/projects/yui3/download/2531587/sample.html ) and selected to open it with firefox, opened the web console and reloaded the page, here is the log:
That is with Firefox 8.0.1 and I can reproduce it using an old 3.6.24 build too. |
|
Posted: 01/6/12
I'm not sure why that fix didn't get into the commit and pushed, but I just put the proper fix in & pushed to my repo as well as our build server. (long week) |
|
Posted: 01/6/12
I quick run through firebug and it shows me that the mname param in p.test() is an object (the metadata from the module list) not the just name of the module. If the parameter is correct then the test method should be:
(Although I would say that with the caveat that I do not understand the purpose of this test method -- it seems to be checking if it is a gallery module or not.) The mname parameter to test comes from the mname parameter from getModule() which itself comes from being pushed onto the *singles* var in resolve() when it is not a combo. It seems possible that the parameter is wrong and it should just be the name, in that case I guess the change would be here (line 2340):
From what I can tell this is the place to change, if I set a breakpoint in getModule for all the built-in YUI modules it is just the name that is passed in. |
|
Posted: 01/6/12
Fixes #2531587 - Not sure how this commit got missed, but adding it back in now. |
|
Posted: 01/6/12
Yeah, that was fixed yesterday, not sure why that was reverted between then and now. I just added it back in and it works for me now. |
|
Posted: 01/6/12
Sorry, now it doesn't try to load xlogin anymore.. :( |
|
Posted: 01/6/12
You need the seed too: |
|
Posted: 05/10/12
checkedin -> closed |


Jenny Donnelly
Ticket #2531597 was marked as a duplicate of this ticket.