Magento, merge Javascript and mod-pagespeed

Within the last days I got an ugly Javascript error (missing ‘;’ at line 25619), only using MSIE 8 for Magento’s detailed product view… Thinking about the latest changes done I was able to find the reason:  It was a combination of the enabled Javascript merge function of Magento together with Google’s mod-pagespeed extension for Apache.

The line number 25619 of the merged Javascript file was in reality line number 564 of js/varien/product.js…

There we have this:

this.skipCalculate = config.skipCalculate;//@deprecated after 1.5.1.0

The comment on this line is problematic for MSIE and the setting, described on top, I think especially the ‘@’ was the reason for the error.

I have removed the comment completely:

this.skipCalculate = config.skipCalculate;

The error is gone now even with Magento’s Javascript merging enabled. 😉

Leave a Reply

Your email address will not be published. Required fields are marked *