Pergunta

This getting this error on a particular form in Magento 2.3.0. I think this error causes invalid form key sometimes when submitting the form. How to solve this following error.

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined
    at Object.getFromServer (customer-data.js:90)
    at Object.reload (customer-data.js:333)
    at UiClass.initialize (minicart.js:105)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at Object.deferred.<computed> (jquery.js:3461)
    at fire (jquery.js:3232)
Foi útil?

Solução

I fixed it by adding the 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>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top