-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Load timeout when using require-css, but only for new tabs #177
Comments
You know, if you had an option for logging the actual load order at runtime then a lot of these kind of bug reports would go away. We could compare "good loads" with "bad loads" and see where the loading order differed and how it led to timeouts or circular dependency problems. This would also help us differentiate between user error and actual bugs in the library. Right now we're trying to diagnose this blind. |
So I guess stick waitSeconds to 0, and see if everything is loading correctly in the network tab? |
@guybedford In point 1 I mentioned that Because this is a race-condition, the only way to figure out what is going wrong is for you to add more logging and have me compare the good case (where a timeout does not occur) to the bad case (where a timeout occurs) and is different between the two cases. Perhaps this issue only happens when files are loaded in a particular order. I have a theory this could be a bug in Chrome (I am specifically eyeing https://code.google.com/p/chromium/issues/detail?id=424599) but again there is no way for me to prove one way or another without more logging on your part. |
Ok sure, some debugging tips:
Let me know how it goes. |
I ended up implementing logging a bit differently. I set
before https://github.com/guybedford/require-css/blob/master/css.js#L131 and then changed all references from I believe this approach is better because we log immediately before loading the resource (as opposed to logging outside a I got some odd results. When the page loads correctly I see:
but when a page fails to load, I see:
I only managed to reproduce this once so far so these results are shaky (I'd like to reproduce this a couple of times to make sure I see the same behavior). I'd also like to fix http://stackoverflow.com/q/26809000/14731 because I read somewhere that problems with circular dependencies sometimes trigger problems with require-css. |
That is a really strange failure case, perhaps add a log in https://github.com/guybedford/require-css/blob/master/css.js#L128 and https://github.com/guybedford/require-css/blob/master/css.js#L161 to see where the URL is being given wrong. If the input URL is wrong, then the issue is outside of the scope of RequireCSS! |
@guybedford What values do you want me to log in https://github.com/guybedford/require-css/blob/master/css.js#L161? |
I think this issue might be a bug in require.js instead of the CSS plugin. I inserted I got this log:
This is on top of the extra logs I had in require-css, but as you can see the latter logs were never triggered. What test should I try next to narrow this down? |
I'm not sure RequireJS will be calling that for plugins? I was just referring to logging the name / URI in the
etc? |
@cowwoc do you happen to know what the |
@F1LT3R Sorry no. I have moved on from require.js. |
Version 0.1.7, Chrome 38.0.2125.111 m
I can reproduce a problem 100% of the time where I open a new tab, load my application and the page fails to load with:
Load timeout for modules: requireCss!css/video_unnormalized2,requireCss!webjars/jquery-ui/css_unnormalized3,requireCss!css/steps/foo_unnormalized5,requireCss!css/video,requireCss!webjars/jquery-ui/css,requireCss!css/steps/foo
waitSeconds: 0
the page hangs forever.<script>
references:where
RequireConfig.js
contains:Looking in Developer Console, Network tab I can see
css.js
is being found all right.Any ideas?
The text was updated successfully, but these errors were encountered: