Magento2: cannot read property 'section loadurl' of undefined in all pages - Custom Theme

Created on 21 Feb 2017  路  4Comments  路  Source: magento/magento2


Preconditions


  1. Magento version - 2.1.3
  2. PHP - 5.6

Steps to reproduce


It was working fine until last week... but after I updated my footer styles this issue occurs. I reverted my footer changes but the issue is still present. This is happening if I'm using my custom theme. When I change to default Luma theme JS error is not showing.

Expected result

  1. Page Main content need to be displayed

Actual result

  1. But instead, I'm getting JS error on pages like homepage, login, register etc.

issue3

issue4

Format is valid needs update

Most helpful comment

I'm was getting the same error too, with Magento version - 2.1.5, PHP - 7.0.6,
I had previously removed "content" container from customer module,
I fixed it by adding following code to layout.xml

    <referenceContainer name="content">
        <block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
               template="Magento_Customer::js/section-config.phtml"/>
        <block name="customer.customer.data"
               class="Magento\Customer\Block\CustomerData"
               template="Magento_Customer::js/customer-data.phtml"/>
    </referenceContainer>

All 4 comments

I'm was getting the same error too, with Magento version - 2.1.5, PHP - 7.0.6,
I had previously removed "content" container from customer module,
I fixed it by adding following code to layout.xml

    <referenceContainer name="content">
        <block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
               template="Magento_Customer::js/section-config.phtml"/>
        <block name="customer.customer.data"
               class="Magento\Customer\Block\CustomerData"
               template="Magento_Customer::js/customer-data.phtml"/>
    </referenceContainer>

@anjanaVoilaah thank you for your feedback.
Please provide exact steps in format:

Steps

  1. ....
  2. ....
  3. ....

@anjanaVoilaah thank you for your report. Unfortunately, we can not fix the issue in the core if we can not reproduce it. We are closing the issue for now. If you'd like to update it, please reopen the issue.

I am getting the error in console like this only on categoty page.

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined

I searched in Google for this and fixed the issue, it's created becuase of i have remove magento default main container and create new container so it's created , simple i past bellow code into my container and clear cache and issue was fixed.

<block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
               template="Magento_Customer::js/section-config.phtml"/>
 <block name="customer.customer.data" class="Magento\Customer\Block\CustomerData"
  template="Magento_Customer::js/customer-data.phtml"/>

Hope you understant my cenario and code.

Was this page helpful?
0 / 5 - 0 ratings