JS "Fatal error" is raised on 1st load in IE7-8

  • Problem
  • Updated 3 years ago
When I'm opening the page with latest Galleria version (e.g. Galleria homepage with demo) with IE7 or IE8 I constantly get JS following error:
"Line: 3394
Error: Fatal error: Theme at /media/galleria/src/themes/classic/galleria.classic.js could not load, check theme path."

In IE8 (both standard and compatibility modes), after refusing to debug script and closing this dialog script works normally, but in IE7 it completely fails to start.

It happens every time when gallery script and images are not cached yet (by first visit and on full page reload by Ctrl+F5).

I consider this issue as very critical for the pre-release product.
Photo of streltsyn111S

streltsyn111

  • 4 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 17
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
We can not replicate this on any of our test machines. Can anyone else confirm?
Photo of marer13M

marer13

  • 30 Posts
  • 0 Reply Likes
I'm having a similiar problem (IE only)...

Here's the error message:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Sat, 14 May 2011 22:04:08 UTC

Message: Fatal error: Theme at galleria/themes/classic/galleria.classic.min.js could not load, check theme path.
Line: 78
Char: 380
Code: 0
URI: http://marekmularczyk.com/rupert/gall...

Message: Fatal error: No theme found.
Line: 78
Char: 380
Code: 0
URI: http://marekmularczyk.com/rupert/gall...
Photo of streltsyn111S

streltsyn111

  • 4 Posts
  • 0 Reply Likes
Problem is still reproducing for me (Windows XP SP3 Professional, IE 8.0.6001.18702) every time I press Ctrl+F5 on http://galleria.aino.se/ page.
Photo of gdinfG

gdinf

  • 5 Posts
  • 1 Reply Like
Hi There...
I have the same issue. I try with different versions of the gallery and still the same.
I'm trying the gallery on mac: (osX) Safari, Firefox, Chrome
PC: (windows 7) IE8, Firefox
iOS: Safari

The issue occurs on IE8 and Safari (iOS).
Basically if you delete the cache and you load the gallery, the gallery will not be shown and the JS Console will show the error described by streltsyn111.
Photo of bkclerkeB

bkclerke

  • 4 Posts
  • 0 Reply Likes
I am having the same problem on first load I get the fatal error message. Once the images have been cached and I reload the page the gallery works fine but for people first visiting, this is not good.
Photo of cynthiamsolisC

cynthiamsolis

  • 2 Posts
  • 0 Reply Likes
Ditto
Photo of regevazR

regevaz

  • 1 Post
  • 0 Reply Likes
i'm having the same issue too. on ie9, deleting the browsing history and cache reproduces it. btw - i'm using the (not free!) twelve gallery...
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
Are you saying you get the error on all setups? because we cant reproduce it anywhere. Can we at least nail it down to an OS / browser version?
Photo of gdinfG

gdinf

  • 5 Posts
  • 1 Reply Like
No, I'm saying that the error only appears on windows 7 / IE8 and on iOS Safari.

I just delete the line: Galleria.loadTheme('galleria/themes/galleria.classic.js');
and add on script tag: src="galleria/themes/galleria.classic.js"
And windows 7 / IE8 is working fine... but iOS Safari is not showing the gallery at all with that setup (not even reloading)
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
are we still taqlking about the demo page at http://galleria.aino.se/media/galleri... (not a local copy) ??

If not, we need a link to your test environment.
Photo of gdinfG

gdinf

  • 5 Posts
  • 1 Reply Like
No I was talking about a local copy that I download from the site... the error was that my site had a different !Doctype... probably streltsyn111 had the same issue. If the !doctype is set to HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd
The gallery fail in those browsers.
Sorry about that! My bad! And thanks for quick answers David!
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
That's an interesting observation though, we will add that to our test suite. Thank you for your effort in reporting bugs and improvements!
Photo of gdinfG

gdinf

  • 5 Posts
  • 1 Reply Like
Hi David,
Apparently the same is happening. I'm testing it now with galleria.aino.se and is showing me the gallery but is giving me this same error (I'm uploading a capture) and in iOS is not showing the images at all... (with the same error in the console...)
Photo of streltsyn111S

streltsyn111

  • 4 Posts
  • 0 Reply Likes
As far as I know, doctype difference between XHTML1.0 Transitional and HTML 4.01 Transitional can't have such effect, especially in IE7 (according to the excellent doctype study at http://hsivonen.iki.fi/doctype/ and my experience). I experienced the bug on the Galleria home page (http://galleria.aino.se/) and on the demo page at http://galleria.aino.se/media/galleri... as well, so doctype seems not to be an issue.

The most strange thing is that sometimes (in IE8) the gallery loads normally after raising the error (is the error really fatal?)
Photo of gidisraelG

gidisrael

  • 2 Posts
  • 0 Reply Likes
I have the same problem! The exact same error are gdinf, on the exact line and char.

On IE, like streltsyn111 says, the gallery still loads up fine, but on chrome 7 nothing shows (No pics at all)
Im on Win7 x64.

Currently I have a notice on the bottom of the page that says "Please refresh if you don't see anything! =( "
Photo of gdinfG

gdinf

  • 5 Posts
  • 1 Reply Like
I was testing it again... and the same things is going on...
The problem basically occurs at galleria.aino.se/media/classic-demo.html
(and on the one that I'm downloading and testing locally too...)
First time I enter with a clear cache the gallery show's the js error and will not show up (on internet explorer and on safari for iOS)

Now... the one from the home page: galleria.aino.se even if it's giving me the same error, the gallery is showing up and it's functional... is the gallery on the home page using another js?

Thanks!
Gas
Photo of tmiseurT

tmiseur

  • 4 Posts
  • 0 Reply Likes
I have this as well, but only in IE. I believe it has to do with a 1000ms timeout set in galleria.js. If it cannot find the theme css/js (can't remember which one) within this time, it'll throw the error. This only happens on a clear cache and is more likely to happen on lower bandwidths from my experience.

I can't provide much scientific evidence of this, but IE seems to retrieve each page resource in a single-threaded manner whereas firefox starts downloading each resource simultaneously (according to firebug) so presumably it is able to link to the theme css/js faster.

My workaround was to pre-cache all of the images in my gallery using a javascript preloader. This incidentally also solved another problem I had with Galleria generating corrupt thumbnails in Firefox when there were many images in the gallery (30+ at least).
Photo of malaika1818M

malaika1818

  • 5 Posts
  • 0 Reply Likes
hey is there any way you could contact me and walk me through what you did for the precaching of the photos. It's happening to me and I'm not 100% literate on how to do these things. I have 100+ photos in each of the galleries I've set up.
Your help would be much abliged!
Photo of tmiseurT

tmiseur

  • 4 Posts
  • 0 Reply Likes
Just to add... all of my problems have gone away since adding references to both galleria.classic.js and its corresponding .css in my head tag (including the loadTheme() call). I think it's just a multithreading issue where Galleria gets ahead of itself depending on how the browser is treating page resources.
Photo of marer13M

marer13

  • 30 Posts
  • 0 Reply Likes
Would you share with us how exactly you did that, please?

Thank you.
Photo of SergioS

Sergio

  • 7 Posts
  • 0 Reply Likes
Similar problem here. I agree with tmiseur, it seems to be a problem with IE not being able to retrieve the files the way galleria asks for. In my case, the problem with theme load has gone away by loading the theme (both js and css files) directly in the head tag. The theme works now, but then no image is loaded at all inside galleria (although I think they're cached).

And here comes the weird stuff: if you reload the page (through js or user action), IE retrieves again all of the files and the problem remains; but if you just revisit the page (by re-entering the url, clicking on a link to itself or executing window.location.href = window.location.href), voilà! It works! So, it works fine when IE doesn't have to retrieve any file and just picks them up from the cache. Funny, isn't it?

Then, here is my awful workaround: when all loading is done, if there's no image inside galleria, revisit the page...


$(window).load(function() {
// Little delay to avoid infinite revisiting
setTimeout(function() {
if($('.galleria-image img').length == 0)
window.location.href = window.location.href;
}, 100);
});
Photo of marer13M

marer13

  • 30 Posts
  • 0 Reply Likes
Hi Sergio,

Where exactly in the code do you add the code you posted above?

I tried to add it in the head section after opening tag for script in the head section:
and it's still showing the error message in IE...
Photo of marer13M

marer13

  • 30 Posts
  • 0 Reply Likes
And now it doesn't work on Firefox... (it doesn't even load the gallery, it keeps reloading the page)
Photo of SergioS

Sergio

  • 7 Posts
  • 0 Reply Likes
Try this...


if($.browser.msie)
$(window).load(function() {
// Little delay to avoid infinite revisiting
setTimeout(function() {
if($('.galleria-container').length > 0 && $('.galleria-image img').length == 0)
window.location.href = window.location.href;
}, 300);
});
Photo of nutsN

nuts

  • 1 Post
  • 0 Reply Likes
same problem with IE8, even on

http://galleria.aino.se/

I will try the solution provided by Sergio...
Photo of havercH

haverc

  • 1 Post
  • 0 Reply Likes
Hi there, did anyone solve the problem about the docteype issue??
When i use doctype html 4.0 the galleria crashes.



this was the debugging output from the IE. If i take doctype 1.0 it works .. Unfortunately then i have change the hole css...
Photo of mikegM

mikeg

  • 10 Posts
  • 0 Reply Likes
@tmiseur - are you talking about adding this code to the header...?

< LINK REL=STYLESHEET TYPE="text/css" HREF="galleria.classic.css" >

and how do you reference the galleria.classic.js in the header other than...?

< script src="../../galleria-1.2.2.min.js" >< /script >

If anyone can provide the actual code to get rid of this error that would be great. I'm using the Classic theme right now and I want to buy the Twelve theme but I'm thinking this error is in every theme. A solution would be great. I need to load more than 30 images.
Photo of mikegM

mikeg

  • 10 Posts
  • 0 Reply Likes
I thought the fix was discussed in another thread shown here:

http://getsatisfaction.com/galleria/topics/its_great_but_no_ie6_compatibilty_is_a_real_problem

but I found out it still doesn't work. The fix above works "sometimes."
Photo of eclipticevaderE

eclipticevader

  • 1 Post
  • 0 Reply Likes
I'm having the same issue, in IE 8 and 7, when loading the page for the first time with a cleared cache I get the fatal error that it can't load the theme.

After about 6 hours of work I concluded (just my theory) that Galleria doesn't do very well with either really large images, or a LOT of images. Either way it seems to choke when there is a lot of data to preload.

For my example, I am implementing this in a place where clients can upload a max of 100 images, and each image can be a max of 2.5 MB. The place I found the problem was with a slideshow with 36 images, and each image was around 700k - 1.5mb. Not too terrible. The problem was it would start to load the images in IE and then thrown the fatal error because it was trying to grab the theme before all the images had completed downloading. I tried pre-preloading the images as one suggested, and even adding references to the theme files in the head section, but to no avail.

Eventually I had to go into the galleria-1.2.2.js file (non-minified) and modify the timeouts for various functions to account for lots of data. I changed the timeouts for the theme loading and image loading functions. These can be found at lines: 1571, 3670, 3901 in the un-minified file. I changed my timeouts to really long timeouts like 600000ms just to be safe. Chances are no user would wait that long, but I'd rather have the page still be loading than an error shown to the end user.

It seems as though Galleria was never meant to load a lot or images, or very large images (which sort of defeats the purpose of the twelve theme w/ full screen).

I also found another issue of sorts in Firefox. With the really large images, the preloading gets caught in some sort of infinite loop. The progress indicator in the tab spins never stops, and the status bar always says "transferring data from ..." After looking at the net panel in Firefox, it seems that if an image is so large it hits the timeout (which is 10 seconds by default I believe) galleria just tries to load the image again...and again, and again, causing what seems like an "infinite load" to the end user. I fixed this by modifying the timeout in the galleria js for loading images from 10 seconds to about 1.5 mins.

On a semi related note, I'm kind of disappointed that it's been 5 months since this issue was reported and there's pretty much no progress from the devs. I'm starting to re-evaluate purchasing the twelve theme if this is the level of support to expect.
Photo of malaika1818M

malaika1818

  • 5 Posts
  • 0 Reply Likes
Hey. Thanks for this. Going to try it out this week and let you know how it goes. Could you comment how you changed the last part... The Firefox fix in particular in the .js file. Changing it from 10sec to 1.5min.

Thank you. And I definitely agree. The support has been less than attractive. I run a business and if I provided support to clients as such... Well. I wouldnt be running a business.
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
May I just point out that this was posted 9 months ago and the issues described here have been addressed several times. If you are using a drupal module called "Galleria" as some of you are saying you do, it is in no way officially supported by us.

Being a javascript module that is implemented in an existing environment without iframes, it does have some requirements that needs to be met to work properly. The best guide to read up on if you are having loading issues is this one: http://galleria.io/docs/1.2/reference...
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
There has been a dozen of issues surrounding the IE load problem. And we are very well aware of it. The main concern here is that IE7 and below only allows two download slots for the client, and IE8 only allows 6. This means that if you put large amount of data on one page, the requests will queue up pretty fast. You can read more about it and "fix" it here: http://support.microsoft.com/kb/282402

This means that scripts and other external data files will eventually be of lower priority for the browser. This problem is not caused by Galleria, it’s a core browser "feature". You will have similar issues when placing 100 IMG tags with 3-4 mb images on one single page and then load other data using ajax at the same time.

When using Galleria, this can lead to that the client will not load the theme file or other dependencies in time, resulting in an error. We have increased timeouts but that doen’t really "fix" the problem. Instead we insist on optimizing the data stream using separate thumbnails, JSON data, optimized images and not more than 30 images in one requested gallery. We even wrote an article about it in the docs: http://galleria.aino.se/docs/1.2/refe...

As we see it, the error is not the problem, even if it’s cryptic sometimes. The error thrown is more like a warning to alert the author that some optimizations need to be done.

We’ll definitely have a look through the messages and print out more humanly readable error notes.
Photo of infoI

info

  • 1 Post
  • 0 Reply Likes
David, your explanation makes sense. I just today ran into this issue. Interestingly enough - it pretty much started coming up when upping the 25 images to 35. Now I have to see if reducing the images below 30 will work for the client, using IE7
Photo of mikegM

mikeg

  • 10 Posts
  • 0 Reply Likes
It's really too bad Galeria has this limitation in IE and FireFox, especially considering IE8 is the most common browser today. I really like the functionality and layout of the Twelve theme and it would be great to use in my new project but I need it to load more than 30 images. I noticed Galleriffic has a "smart preload" function which seems to allow it to display instantly and without error but I'm going to have to test it to see if it can handle about 100 images of about 100K each.

David, maybe you could look at the code for Galleriffic and incorporate their loading procedure into Galleria? That would be superb.
Photo of David

David, Author

  • 1221 Posts
  • 143 Reply Likes
@mikeg: There are no limitations in the software, 30 images is just a recommendation if you want the gallery to run smoothly "out of the box". If you f.ex use custom thumbnails that are smaller and load the theme earlier in the source code, you can easily have 100+ images, since Galleria only loads the thumbnails onload and preloads the larger images when needed.

All we are saying is that browsers do have limitations, and requesting 100+ images over 100k each will slow down any client, regardless of gallery software. That is why we heavily recommend custom thumbnails, JSON data and sometimes loading the theme in the head since it optimizes the data stream, making it possible to add more images without slowing down the client.
Photo of mikegM

mikeg

  • 10 Posts
  • 0 Reply Likes
David - thanks for the tips, it seems to have worked as I'm not getting the error now with 50 images about 75k each. When you say load the theme early do you mean adding this line to the head section...?

$('#galleria').galleria();

and then loading the theme with parameters later in the body? Because without loading the theme in the body I get a static page of thumnail images.

I'm going to really try to make this work because I like the Twelve theme better than anything else out there. I'm hoping I can add a sliding thumb row at the bottom of the Twelve theme so it looks similar to the Classic theme, but I still like the page of thumbs that show up over the Twelve theme's stage and I especially like the fullscreen option.