apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
696 stars 158 forks source link

Pagespeed is not defined #1316

Open MiguelQueiroz opened 8 years ago

MiguelQueiroz commented 8 years ago

Hi guys. This is a recurring error on the console. Sometimes it shows sometimes not. So i dont really know the source of the issue. All i can quote is the azure insights about these exceptions. Which is below.

Exception type pagespeed is not defined … Failed method HTMLImageElement.onload … Custom Data url http://www.beautiapp.com/calendarException Message pagespeed is not defined ReferenceError at HTMLImageElement.onload (http://www.beautiapp.com/calendar:1:1) HTMLImageElement.onload calendar: 1

It does happen in any page randomly.

jmarantz commented 8 years ago

What browser is this? I tried refreshing your URL on Chrome a few times and did not see the error.

I suspect the reason for the randomness you are seeing is that the message comes as a result of the 'critical images' beacon. This is a JavaScript fragment that PageSpeed injects into your page periodically, to compute which images are visible "above the fold" in users' browsers. It doesn't do this on every request, so it looks random to you.

I have a guess that there is some code in our beacon from our support library that is tuned to older Microsoft browsers and needs to be updated to newer Microsoft browsers. You are running PageSpeed 1.9, which is now a little out of date; we released 1.11 to stable this month. It's possible the support library we are using has caught up to the newer browsers. But if you let me know which browser you are using then we can check.

-Josh

On Mon, May 23, 2016 at 6:59 AM, Miguel Queiroz notifications@github.com wrote:

Hi guys. This is a recurring error on the console. Sometimes it shows sometimes not. So i dont really know the source of the issue. All i can quote is the azure insights about these exceptions. Which is below.

Exception type pagespeed is not defined … Failed method HTMLImageElement.onload … Custom Data url http://www.beautiapp.com/calendarException Message

pagespeed is not defined ReferenceError at HTMLImageElement.onload (http://www.beautiapp.com/calendar:1:1 http://www.beautiapp.com/calendar:1:1) HTMLImageElement.onload calendar: 1

It does happen in any page randomly.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pagespeed/mod_pagespeed/issues/1316

MiguelQueiroz commented 8 years ago

I have chrome last version. It does happen in any browser. I found a way to trigger that. This is by clicking on the menu, in another option for example > industry > hair Salons.. It will trigger an ajax loading, that will cause that error 32 times.

MiguelQueiroz commented 8 years ago

Can i upgrade the version with no downtime?

crowell commented 8 years ago

You will have to restart Apache in order to complete the upgrade. Apache is pretty quick to restart, you don't need to restart the entire machine. On May 28, 2016 9:01 AM, "Miguel Queiroz" notifications@github.com wrote:

Can i upgrade the version with no downtime?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pagespeed/mod_pagespeed/issues/1316#issuecomment-222307393, or mute the thread https://github.com/notifications/unsubscribe/AAlnYN1i_J4_9TeYQm3-2qK1GwXEpiewks5qGDx1gaJpZM4IkaS4 .

jmarantz commented 8 years ago

You can use an Apache graceful restart https://httpd.apache.org/docs/current/stopping.html to upgrade mod_pagespeed with no downtime.

-Josh

On Sat, May 28, 2016 at 12:00 PM, Jeffrey Crowell notifications@github.com wrote:

You will have to restart Apache in order to complete the upgrade. Apache is pretty quick to restart, you don't need to restart the entire machine. On May 28, 2016 9:01 AM, "Miguel Queiroz" notifications@github.com wrote:

Can i upgrade the version with no downtime?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/pagespeed/mod_pagespeed/issues/1316#issuecomment-222307393 , or mute the thread < https://github.com/notifications/unsubscribe/AAlnYN1i_J4_9TeYQm3-2qK1GwXEpiewks5qGDx1gaJpZM4IkaS4

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pagespeed/mod_pagespeed/issues/1316#issuecomment-222315659, or mute the thread https://github.com/notifications/unsubscribe/AB2kPYOCZzHN13bVEK0Qxhy8ps2Z9E7_ks5qGGaegaJpZM4IkaS4 .

mrpedrodias commented 8 years ago

I upgraded from 1.9.32.14 to 1.11.33.2 today and I started getting Uncaught ReferenceError: mod_pagespeed_FOO is not defined issues in my WordPress installation. This caused parts of the Tinymce editor not to load, so I had to disable mod_pagespeed to be able to restore the functionality.

Similar to this https://github.com/pagespeed/ngx_pagespeed/issues/476 It only happens when I'm logged in to Wordpress, it seems to be unnoticeable from the outside

Settings Ubuntu 14.04.4 LTS Apache/2.4.20 (Ubuntu)

jmarantz commented 8 years ago

searchdude: as a quick workaround can you try: ModPagespeedDisableFilters combine_javascript You might even be able to put this in a <Directory ..../wp_admin/> scope. That should fix that particular problem. Ideally, we'd like to see a URL to the page in question.

An alternative workaround would be something like: ModPagespeedDisable tinymce.js*

On Fri, Jun 3, 2016 at 2:22 PM, searchdude notifications@github.com wrote:

I upgraded from 1.9.32.14 to 1.11.33.2 today and I started getting _Uncaught ReferenceError: mod_pagespeedFOO is not defined issues in my WordPress installation. This caused the Tinymce editor not to load, so I had to disable mod_pagespeed to be able to restore the functionality.

Similar to this pagespeed/ngx_pagespeed#476 https://github.com/pagespeed/ngx_pagespeed/issues/476 It only happens when I'm logged in to Wordpress, it seems to be unnoticeable from the outside

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pagespeed/mod_pagespeed/issues/1316#issuecomment-223655122, or mute the thread https://github.com/notifications/unsubscribe/AB2kPXIHpKYCS28f7moIDN_iS35x_hFlks5qIHDwgaJpZM4IkaS4 .

mrpedrodias commented 8 years ago

jmarantz: My URL is https://www.pedrodias.net/ but I disabled the module for now. Gonna check what you suggested

EDIT: OK I added ModPagespeedDisableFilters combine_javascript ModPagespeedDisableFilters combine_css

And now everything is back to normal

I had also to enable ModPagespeedJsPreserveURLs on ModPagespeedImagePreserveURLs on ModPagespeedCssPreserveURLs on

as some CSS URLs were returning a 403 status

oschaaf commented 8 years ago

Cross linking a similar report for ngx_pagespeed: https://github.com/pagespeed/ngx_pagespeed/issues/1219

dave-hillier commented 7 years ago

I am also getting similar errors as reported by @MiguelQueiroz

I override the global error handler and intercept errors where my script is in the callstack.

It happens across numerous sites and browers

omrseo commented 7 years ago

Please help..my url is https://www.uniparfum.com i'm using prestashop and the problem appeared when i installed mod page speed which broke the whole site. i didn't find the mod page speed on etc/httpd/conf.d i'm using centos!! any idea?

oschaaf commented 7 years ago

@omrseo It looks like mod_pagespeed is currently disabled on the site. There still are some js errors, perhaps those worsen when mod_pagespeed is enabled. I think it's worth trying again after fixing the js errors, or alternatively enable mod_pagespeed but with rewrite_javascript disabled..