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

  • 17
  • Problem
  • Updated 4 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 streltsyn111

streltsyn111

  • 4 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 17
Photo of streltsyn111

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 gdinf

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 bkclerke

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 cynthiamsolis

cynthiamsolis

  • 2 Posts
  • 0 Reply Likes
Ditto
Photo of regevaz

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 gdinf

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 gdinf

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 gdinf

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 streltsyn111

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 gidisrael

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 gdinf

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 tmiseur

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 malaika1818

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 tmiseur

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 marer13

marer13

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

Thank you.
Photo of Sergio

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 marer13

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 marer13

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 Sergio

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 nuts

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 haverc

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 mikeg

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 mikeg

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 eclipticevader

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 malaika1818

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 info

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 mikeg

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 mikeg

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.
Photo of Ben

Ben

  • 3 Posts
  • 0 Reply Likes
For those who are using the gallery on a page that's also using Typekit, I was able to solve the problem by placing the code for loading the Galleria theme higher in the head. Libraries like Typekit require lots of downloading, so I think just in general a good way to approach solving this problem is try to load all of the Galleria resources as early on as possible.
Photo of mikeg

mikeg

  • 10 Posts
  • 0 Reply Likes
I think I figured out what I did wrong and it's been working for me without errors since then. I'm using IE8 which I suppose is the most common browser at this time so like it or not, it gets my highest attention.

As I mentioned before, I added the following code to the header section of each of my html files that load each separate gallery which is just a re-write of the file "original.html" from the Classic gallery download:

< LINK REL=STYLESHEET TYPE="text/css" HREF="galleria.classic.css" >
< script src="../../galleria-1.2.2.min.js" >< /script >

then I added the following script in the header also in an 'attemp' to pre-load the galleria (I say 'attempt' because I'm not sure if I did it correctly but it seems to have worked at least for IE8):

< script >
// Load the classic theme
Galleria.loadTheme('galleria.classic.min.js');

// Initialize Galleria
$('#galleria').galleria();
< /script >

Then the mistake I overlooked - and the reason why I still had errors after that - was because I missed loading some thumbnail images when I actually created the div in the body section of the same html file. For example, for every single picture there should be a corresponding thumbnail image:

< div id="galleria" >
< a href="http://www.hawaiivacationsreviews.com..." >
< img title="nice title"
alt="nice description< br >< br >"
src="http://www.hawaiivacationsreviews.com..." width="105" height="70" >
< /a >
etc, etc...
< /div >

My only other advice is to compress the thumbnails as much as possible - currently mine are down to 1k each and although they look terrible, I don't see any errors. But I haven't tested it yet on other browsers.

If anyone gets an error on this site - hawaiivacationsreviews.com - please reply to this thread and let me know. Look at "Magic Island" as this has the highest number of pictures - about 50 currently. Thanks.
Photo of Alejandro Rubalcava

Alejandro Rubalcava

  • 5 Posts
  • 0 Reply Likes
Did this NOT work with IE 7?
Photo of marer13

marer13

  • 30 Posts
  • 0 Reply Likes
I've just looked at the code of your "Magic Island" page and there IS NO link or script code in the header as you mention here.......
Photo of mikeg

mikeg

  • 10 Posts
  • 0 Reply Likes
marer13 - dude, you need to right click on the black area of the slide show on that page to see the correct code. That's because the html file which creates the slideshow is INSIDE AN IFRAME on that page. I just right clicked (on the black area of the slide show) and viewed source code and I see both the LINK statement and the script which pre-loads the galleria along with the comments explaining this. By the way, I'm currently making adjustments so it might look funny temporarily but I still don't see any errors when loading the webpage. I was just trying to be helpful here and was hoping that if someone noticed an error they could alert me to it.
Photo of grknsngn

grknsngn

  • 1 Post
  • 0 Reply Likes
I also have the problem on http://www.kerstindittmar.ch when you go to "Portfolio", sometimes it isn't loaded but after a refresh it works (not only with IE but also Firefox and Google Chrome), any hints?
Photo of Dave

Dave

  • 1 Post
  • 0 Reply Likes
HI

Yep having the same problem as above. it; pretty dreadful I must say. Sometimes it works, sometimes it doesn't in IE7 and 8.It always gives the same fatal error, 'could not load, check theme path'. Whats going on and is there any fix?