Error "Cannot read property 'k' of undefined"

281 views
Skip to first unread message

Miguel Gómez

unread,
Jun 6, 2014, 8:16:13 AM6/6/14
to mod-pagesp...@googlegroups.com
I'm getting this error with latest release on my console. It seems to be related with pagespeed.CriticalImages.checkCriticalImages and pagespeed_url_hash it's a bug? 

Jeff Kaufman

unread,
Jun 6, 2014, 10:01:20 AM6/6/14
to mod-pagespeed-discuss
Do you have an example url we could look at? I'm not seeing this
error on http://modpagespeed.com/lazyload_images.html?PageSpeedFilters=lazyload_images
> --
> You received this message because you are subscribed to the Google Groups
> "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/dd027833-82c5-458c-9580-f7283d1ec7d0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jud Porter

unread,
Jun 6, 2014, 10:03:48 AM6/6/14
to mod-pagesp...@googlegroups.com
That sounds like an issue, although I'm not able to reproduce yet. What browser are you testing with? Can you point me to a URL that is exhibiting the problem? Can you also try testing with "?PageSpeedFilters=+debug" added to the end of your URL and seeing if you get a different message? This will use obfuscated JS which might point more specifically to where the problem is occurring.


On Fri Jun 06 2014 at 8:45:47 AM, Miguel Gómez <fid...@gmail.com> wrote:
I'm getting this error with latest release on my console. It seems to be related with pagespeed.CriticalImages.checkCriticalImages and pagespeed_url_hash it's a bug? 

--

Miguel Gómez

unread,
Jun 11, 2014, 9:30:02 AM6/11/14
to mod-pagesp...@googlegroups.com
Thanks for the tip Jud. When using ?PageSpeedFilters=+debug there is no error at all… :S


El viernes, 6 de junio de 2014 16:03:48 UTC+2, Jud Porter escribió:
That sounds like an issue, although I'm not able to reproduce yet. What browser are you testing with? Can you point me to a URL that is exhibiting the problem? Can you also try testing with "?PageSpeedFilters=+debug" added to the end of your URL and seeing if you get a different message? This will use obfuscated JS which might point more specifically to where the problem is occurring.

On Fri Jun 06 2014 at 8:45:47 AM, Miguel Gómez <fid...@gmail.com> wrote:
I'm getting this error with latest release on my console. It seems to be related with pagespeed.CriticalImages.checkCriticalImages and pagespeed_url_hash it's a bug? 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Jud Porter

unread,
Jun 11, 2014, 9:59:01 AM6/11/14
to mod-pagesp...@googlegroups.com
That's interesting, and points to something failing in our JS compiler flow. It's difficult to debug without a test case though, can you provide a URL that reproduces the issue?
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/1a36ba5e-b934-4aaf-8073-9c08411aa0b2%40googlegroups.com.

FidoBoy

unread,
Jun 11, 2014, 10:31:49 AM6/11/14
to mod-pagesp...@googlegroups.com
Not at this moment sorry, but the page has a infinite scroll witch loads images using Ajax, may be that problem is related with this. Using previous mod_pagespeed I was not having this error

Enviado desde mi iPhone
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/NRUVObITd90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAEnJKPF3kDz90Gduqr98RUUW2TwGcjCXFsJQ3ZunscPPH2%3D7Eg%40mail.gmail.com.

Jud Porter

unread,
Jun 13, 2014, 2:50:04 PM6/13/14
to mod-pagesp...@googlegroups.com
That could certainly be related. We made some enhancements in the most recent version to try to improve critical image detection on more dynamic pages, and you've perhaps stumbled across a bug with those changes. We still haven't been able to replicate, so a test case would be most appreciated.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/E9B98350-374C-4B75-8F18-86DBDAE1719A%40gmail.com.

FidoBoy

unread,
Jun 13, 2014, 3:02:37 PM6/13/14
to mod-pagesp...@googlegroups.com
Can i contact you in private? Email

Enviado desde mi iPhone

Miguel Gómez

unread,
Sep 18, 2014, 11:30:45 AM9/18/14
to mod-pagesp...@googlegroups.com
Hi again, i'm sorry for the delay i haven't had time to this issue until now. The code where i'm getting the error is this:

}, s = function() {
        var b = {}, d = document.getElementsByTagName("IMG");
        if (0 == d.length)
            return {};
        var a = d[0];
        if (!("naturalWidth" in a && "naturalHeight" in a))
            return {};
        for (var c = 0; a = d[c]; ++c) {
            var e = a.getAttribute("pagespeed_url_hash");
            e && (!(e in b) && 0 < a.width && 0 < a.height && 0 < a.naturalWidth && 0 < a.naturalHeight || e in b && a.width >= b[a.src].k && a.height >= b[a.src].j) && (b[e] = {rw: a.width,rh: a.height,ow: a.naturalWidth,oh: a.naturalHeight})
        }
        return b
    }, t = "";

and the variable with the problem is: b[a.src].k i believe that it's because a.src doesn't exists or may be the item doesn't have the src attribute. It should be a check before that line to ensure that b[a.src] exists.

NOTE: This code is compressed, but i think that looking at the original uncompressed javascript code you can locate the piece.

Regards,




El viernes, 13 de junio de 2014 20:50:04 UTC+2, Jud Porter escribió:
That could certainly be related. We made some enhancements in the most recent version to try to improve critical image detection on more dynamic pages, and you've perhaps stumbled across a bug with those changes. We still haven't been able to replicate, so a test case would be most appreciated.

On Wed Jun 11 2014 at 10:31:51 AM, FidoBoy <fid...@gmail.com> wrote:
Not at this moment sorry, but the page has a infinite scroll witch loads images using Ajax, may be that problem is related with this. Using previous mod_pagespeed I was not having this error

Enviado desde mi iPhone

El 11/06/2014, a las 15:58, "'Jud Porter' via mod-pagespeed-discuss" <mod-pagesp...@googlegroups.com> escribió:

That's interesting, and points to something failing in our JS compiler flow. It's difficult to debug without a test case though, can you provide a URL that reproduces the issue?

On Wed Jun 11 2014 at 9:39:07 AM, Miguel Gómez <fid...@gmail.com> wrote:
Thanks for the tip Jud. When using ?PageSpeedFilters=+debug there is no error at all… :S

El viernes, 6 de junio de 2014 16:03:48 UTC+2, Jud Porter escribió:
That sounds like an issue, although I'm not able to reproduce yet. What browser are you testing with? Can you point me to a URL that is exhibiting the problem? Can you also try testing with "?PageSpeedFilters=+debug" added to the end of your URL and seeing if you get a different message? This will use obfuscated JS which might point more specifically to where the problem is occurring.

On Fri Jun 06 2014 at 8:45:47 AM, Miguel Gómez <fid...@gmail.com> wrote:
I'm getting this error with latest release on my console. It seems to be related with pagespeed.CriticalImages.checkCriticalImages and pagespeed_url_hash it's a bug? 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/NRUVObITd90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Miguel Gómez

unread,
Sep 30, 2014, 12:07:53 AM9/30/14
to mod-pagesp...@googlegroups.com
Bump! :)


El viernes, 13 de junio de 2014 20:50:04 UTC+2, Jud Porter escribió:
That could certainly be related. We made some enhancements in the most recent version to try to improve critical image detection on more dynamic pages, and you've perhaps stumbled across a bug with those changes. We still haven't been able to replicate, so a test case would be most appreciated.

On Wed Jun 11 2014 at 10:31:51 AM, FidoBoy <fid...@gmail.com> wrote:
Not at this moment sorry, but the page has a infinite scroll witch loads images using Ajax, may be that problem is related with this. Using previous mod_pagespeed I was not having this error

Enviado desde mi iPhone

El 11/06/2014, a las 15:58, "'Jud Porter' via mod-pagespeed-discuss" <mod-pagesp...@googlegroups.com> escribió:

That's interesting, and points to something failing in our JS compiler flow. It's difficult to debug without a test case though, can you provide a URL that reproduces the issue?

On Wed Jun 11 2014 at 9:39:07 AM, Miguel Gómez <fid...@gmail.com> wrote:
Thanks for the tip Jud. When using ?PageSpeedFilters=+debug there is no error at all… :S

El viernes, 6 de junio de 2014 16:03:48 UTC+2, Jud Porter escribió:
That sounds like an issue, although I'm not able to reproduce yet. What browser are you testing with? Can you point me to a URL that is exhibiting the problem? Can you also try testing with "?PageSpeedFilters=+debug" added to the end of your URL and seeing if you get a different message? This will use obfuscated JS which might point more specifically to where the problem is occurring.

On Fri Jun 06 2014 at 8:45:47 AM, Miguel Gómez <fid...@gmail.com> wrote:
I'm getting this error with latest release on my console. It seems to be related with pagespeed.CriticalImages.checkCriticalImages and pagespeed_url_hash it's a bug? 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/NRUVObITd90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Jud Porter

unread,
Sep 30, 2014, 9:24:30 AM9/30/14
to mod-pagesp...@googlegroups.com
Hi Miguel, thanks very much for the report. I tracked down the issue yesterday (should be b[e] instead of b[a.src] in the minified version) and should have a fix submitted today. We'll also include the fix in our next patch release.

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/73c9c85a-35dc-4e92-9854-746ef3b9f8f7%40googlegroups.com.

Jud Porter

unread,
Sep 30, 2014, 10:15:46 AM9/30/14
to mod-pagesp...@googlegroups.com
This has been fixed in https://code.google.com/p/modpagespeed/source/detail?r=4273

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/NRUVObITd90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Danny Michel

unread,
Mar 2, 2017, 9:14:14 AM3/2/17
to mod-pagespeed-discuss
Still having the infinite scroll issue here
Reply all
Reply to author
Forward
0 new messages