Issue
- After doing a URL Inspection - "Live Test" in the Google Search Console for the homepage of a Liferay DXP site, visual errors will appear in the "Screenshot" preview tab and "Page Resources" as well as "JavaScript console messages" errors will show in the "More Info" tab.
To list and show some of them:
/combo?browserId=other&minifierType=js&languageId=en_US&b=7010&t=1585307742000&/o/product-navigation-control-menu-dxp-theme-contributor/product_navigation_control_menu.js couldn't be loaded
/o/classic-theme/css/aui.css?browserId=other&themeId=classic_WAR_classictheme&minifierType=css&languageId=en_US&b=7010&t=1585307796999 couldn't be loaded
/o/frontend-js-web/everything.jsp?browserId=other&themeId=classic_WAR_classictheme&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&languageId=en_US&b=7010&t=1585307748762 couldn't be loaded
Uncaught ReferenceError: AUI is not defined
Uncaught TypeError: Cannot read property 'run' of undefined
Environment
- Liferay DXP 7.0+
Resolution
- Go to your Liferay site > Public Pages > Configure > Advanced > Robots and configure the
robots.txtas per below:
User-Agent: *
Where
Disallow:
User-agent: Googlebot
Disallow:
User-agent: AdsBot-Google
Disallow:
User-agent: Googlebot-Image
Disallow:
Sitemap: https://${HOMEPAGE}/sitemap.xml${HOMEPAGE}is the homepage of your site, for example: https://www.liferay.com
- In case the issue will persist after the change:
1) Stop the server and clear the content of the following folders:
- Liferay/osgi/state
- Liferay/work
(In Tomcat:)
- Tomcat/work
- Tomcat/temp
2) Restart the server and re-submit the site to the Google tool