Magento – cannot read property ‘section loadurl’ of undefined

customerheadermagento-2.1.3

I'm getting this error on the firebug while loading homepage. Due to this error the pages are not loading fully. only the Header, Nav Menu and Footer and showing. The main content sections are not showing.

Tried a lot to debug the error but not successful. Any help ??

enter image description here

Google Chrome console error

enter image description here

enter image description here

Best Answer

The data that code references (sectionLoadUrl) is usually set in the following snippet that (should) be on every Magento front-end page

<script type="text/x-magento-init">
{"*":{"Magento_Customer\/js\/customer-data":{"sectionLoadUrl":"http:\/\/magento-2-1-4.dev\/customer\/section\/load\/","cookieLifeTime":"3600","updateSessionUrl":"http:\/\/magento-2-1-4.dev\/customer\/account\/updateSession\/"}}}    
</script>

So, either something in your system removed this snippet, or you're somehow invoking the functionality in Magento_Customer/js/customer-data before the snippet's had a chance to run.