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

Problem loading Codemagic during first visit or with empty/disabled cache #21

Closed
dperini opened this issue Mar 11, 2013 · 11 comments
Closed
Assignees
Labels
Milestone

Comments

@dperini
Copy link

dperini commented Mar 11, 2013

I have tested on Firefox, Safari and Chrome that:

http//codemagic.gr

doesn't load correctly when accessed for the first time (with empty/disabled cache).

It is always reproducible on my iMac, just disable the cache in your browser and reload it.

Initially, at load time, some part of the UI is visible while the editors are not visible until subsequent page reloads.

The problem is related to differences in how the page is handled during the first visit and successive reloads from the cache.

So the problem will show itself during the first visit to the page (was my case) and after clearing the cache, or if the user have completely disabled the cache.

It seems related to the RequireJS loader miserably failing to load the "libs/jsuri" file.

The error I get in the console of all the mentioned browsers is:

Uncaught Error: Mismatched anonymous define() module: function (require) {
    require(["libs/jsuri"], function(){
       ... all the source code
    }
    http://requirejs.org/docs/errors.html#mismatch

so the error seems clear enough to me.

Differences in network speed/latency may create these problems in poorly designed/tested loaders. Hope you can fix it, also not the easiest thing.

Diego

@varemenos
Copy link
Owner

Unfortunately I'm still not skilled enough with require.js to debug/fix this issue.
Do you have a high-latency connection?

It could be an issue related to cache busting that h5bp uses to cache files for a long period of time. Or it could be a huge require.js failure from my side (maybe there is something in require.js and AMD that i'm not understanding?).

I always test the result on the developer (local) and production (http://codemagic.gr) servers to make sure there aren't any speed & loading issues, that's why this kinda surprised me. I also tested it myself with chrome, IE and firefox in linux and windows (clearing the cache and all) so it shouldn't be related to a browser. I will try to dig deeper soon.

thank you for taking the time to file the bug!

@dperini
Copy link
Author

dperini commented Mar 11, 2013

Yes my Wifi/ADSL connection is not reliable nor performant.

... only good enough to spot these kind of asynchronous bugs :)

Diego

On Mon, Mar 11, 2013 at 4:22 PM, Adonis K. notifications@github.com wrote:

Unfortunately I'm still not skilled enough with require.js to debug/fix
this issue.
Do you have a high-latency connection?

It could be an issue related to cache bustinghttps://github.com/h5bp/html5-boilerplate/blob/v4.1.0/doc/htaccess.md#cache-bustingthat h5bp uses to cache files for a long period of time. Or it could be a
huge require.js failure from my side.

I always test the result on the developer (local) and production (
http://codemagic.gr) servers to make sure there aren't any speed &
loading issues, that's why this kinda surprised me. I also tested it myself
with chrome, IE and firefox in linux and windows (clearing the cache and
all) so it shouldn't be related to a browser. I will try to dig deeper soon.

thank you for taking the time to file the bug!


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-14719257
.

@varemenos
Copy link
Owner

@dperini do you or your ISP use some kind of a proxy? Because the way I'm versioning the files is through a GET parameter and some proxies ignore GET parameters, so your browser wouldn't know that I updated the files and use the old ones

@dperini
Copy link
Author

dperini commented Mar 12, 2013

I have the browser cache disabled, there should be no 'old' files.
As an example assume a visitor loading your site for the firs time.
That's when the faulty behaviour I described shows up.

And no, I am not behind a proxy so discard that possibility.

@varemenos
Copy link
Owner

I see what you mean, I just managed to reproduce it myself.
I will try later to get rid of jsuri and see if that will fix the issue

@varemenos
Copy link
Owner

@dperini, could you give it a try now?
Commit 365d9d7 removes the jsUri library.

@dperini
Copy link
Author

dperini commented Mar 13, 2013

Just retried with these browsers: FF, Safari, Chrome, Opera. It seems "jsuri" was not the problem.
The problem persists, the full UI is not rendered during the first visit or with disabled cache.
It loads and work ok after subsequent page refresh if the cache is not completely disabled.
The error I get is pointing to "require.js" in line #8 of the minified source.
So, most probably, it is a RequireJS problem with loading assets.

@varemenos
Copy link
Owner

Ok, it seems like I will need to study requireJS a bit more and either fix the issue or move away from it.
Thank you for your time Diego!

@varemenos
Copy link
Owner

hey @dperini, could you check if you can still reproduce this issue? Commit 68e044e should have fixed this issue

@dperini
Copy link
Author

dperini commented Mar 24, 2013

Adonis, I retested this and I can confirm the problem is solved.
I retried in FF, Chrome and Safari with no problems at all.
Happy you could fix it ! It looks like a great project :)

@varemenos
Copy link
Owner

Thanks again for spending your time debugging this for me.
I will be adding more features in the future but for now I will be a pretty idle cause I'm suffering of tendonitis :(

@ghost ghost assigned varemenos Nov 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants