Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent chromium builds breaking head.js #99

Closed
sinejoe opened this issue Feb 25, 2011 · 18 comments
Closed

Recent chromium builds breaking head.js #99

sinejoe opened this issue Feb 25, 2011 · 18 comments
Assignees
Milestone

Comments

@sinejoe
Copy link

sinejoe commented Feb 25, 2011

I don't know what exact build number of Chromium began behaving this way, but they refuse to load more than one .js file in the head.js function. Specific example below. I know the bug may lie within Chromium rather than head.js, but wanted to bring this to your attention in case.

# Works fine in Chromium (build currently 76043, v11.0.684.0) 
# Works fine in Chrome latest release (v9.0.597.102)
head.js(
    {JQ: "https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"},
    function() {
        alert('success!');
    }
)

# DOES NOT WORK in Chromium (build currently 76043, v11.0.684.0) 
# Works fine in Chrome latest release (v9.0.597.102)
head.js(
    {JQ: "https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"},
    {JQ_UI: "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"},
    function() {
        alert('success!');
    }
)

Thanks for such an excellent, elegant script to manage the mayhem!

@tipiirai
Copy link
Member

does it happen with this the latest dev version:

https://github.com/headjs/headjs/raw/dev/src/load.js

unfortunately I don't have that version of Chromium available right now.

@benhoskings
Copy link

I can confirm this issue in WebKit nightlies too. This loads only a.js, and doesn't fire the callback:

head.js(
  "/scripts/a.js",
  "/scripts/b.js",
  function() {
    ...
  }
)

Tested against WebKit nightly 5.0.3 (6533.19.4, r79746) and load.js @ 1ef6250.

@jstates
Copy link

jstates commented Mar 1, 2011

Yes, I can confirm the problem also... Now the dev version of Chrome has the same issue.

@joepestro
Copy link

Yes, this is also happening with the dev version of Chrome and the latest dev version of head.js (https://github.com/headjs/headjs/raw/dev/src/load.js).

@benhoskings
Copy link

I just reduced this a bit more. When isAsync is false, api.js eventually results in scriptTag being called for each script, which writes a script tag into the DOM like so:

<script type="text/cache" src="/scripts/jquery.js"></script>

But the script is never loaded by the browser (it doesn't appear in the 'Network' pane in web inspector). This seems to be the root of the problem.

So, head.js stalls after the first file because the first element in the list is loaded using load(), and each subsequent one cached using preload(), to be loaded with load() next time. But, the text/cache script tags written by preload() never load, and so their onload handlers (and the next script's load()) never run.

@tipiirai
Copy link
Member

tipiirai commented Mar 2, 2011

would really love to dig into this issue. I'm using Linux. is latest webkit/chromium available for Linux?

@benhoskings
Copy link

Yep: http://www.chromium.org/getting-involved/dev-channel

I'm on 11.0.686.1 (on OS X).

@Porta
Copy link

Porta commented Mar 2, 2011

I can confirm this issue on Chromium 11.0.688.0 (76501) Ubuntu 10.04

@PPP01
Copy link

PPP01 commented Mar 2, 2011

I can confirm this issue for OS X and windows (XP/7) (Chrome 11.0.686.1 dev) and the latest load.js.
Just the first JS gets loaded.

@akaspin
Copy link

akaspin commented Mar 3, 2011

Confirm too. Windows 7, Chrome 11.0.686.1 dev

@tipiirai
Copy link
Member

tipiirai commented Mar 3, 2011

OK. Managed to install latest Chromium and indeed the bug is there. I can see that it does not load scripts into cache if script type is set to something that the browser does not understand such as "text/cache" - so preloading in that manner is not possible.

The browser also does not execute scripts in order they are inserted - like Firefox and Opera does. Right now I don't know a reliable way of executing scripts in order in this browser.

Would like to find more information about the topic on this release or will this be changed on the production release. Does anyone know? Or where are the release notes for this release?

To be honest I'm a bit worried.

@AlexJWayne
Copy link

I'm getting this on the most recent Chrome dev channel release 11.0.686.3.

I hope this is something that doesn't break head.js forever, as I love it. Good luck :(

@AlexJWayne
Copy link

BTW, as a fallback to prevent breakage you could just internally load and execute scripts serially if you detect an environment where things will explode. It's admittedly a hack, but slow and working is preferable to not working.

@tipiirai
Copy link
Member

tipiirai commented Mar 9, 2011

Right now I'm waiting to get some more information about upcoming Chromium. Maybe the implementation will change on the final release, who knows. But this is something serious for sure.

@d4tocchini
Copy link

man, thought I was going crazy! this is a deal breaker, hopefully it gets worked out...

@PPP01
Copy link

PPP01 commented Mar 14, 2011

Hi, with the latest chrome update head.js works again :-)
Chrome Version 11.0.696.3

@headjs
Copy link
Collaborator

headjs commented Mar 14, 2011

YES!

I'm happy again.

Maybe they listened to Kyle:

https://bugs.webkit.org/show_bug.cgi?id=50115

@ghost ghost assigned tipiirai Apr 26, 2011
@tipiirai
Copy link
Member

closing this one. working on 1.0 and ignoring this particular state in chromium browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants