cancel
Showing results for 
Search instead for 
Did you mean: 

Error Broken reference: The element with the ”customer“ ID wasn't found. Verify the ID and try again

Error Broken reference: The element with the ”customer“ ID wasn't found. Verify the ID and try again

(I reported this originally here: https://magento.stackexchange.com/questions/277655/magento-2-getting-error-broken-reference-the-elem... )

am getting lots of

Broken reference: The element with the "customer" ID wasn't found. Verify the ID and try again. [] []

errors in the error.log. I've googled around and tried to trace it with NetBeans but I can't track down what's causing it. Everything seems to be working perfectly except this error is getting written repeatedly.

As some background, I migrated my site from 1.8.1 to 2.3 (and have since upgraded to 2.3.1 but the error started in 2.3). I wonder if something hasn't migrated correctly. Note it occurs in both developer and production mode.

 

I eventually tracked this down to the following lines in my app/design/frontend/vendor-name/theme-name/Magento_Theme/layout/default.xml where I am adding the classes header and links to the <ul> tag for the panel header:

<referenceContainer name="header.panel">
  <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
    <arguments>
      <argument name="css_class" xsi:type="string">header links</argument>
    </arguments>
  </block>
</referenceContainer>

I have no idea why this causes an error. I found the following does the same but without the error (I've highlighted the change from above in upper case although in reality it needs to be lower case). Again I have no idea why this is more successful! Can anyone explain what's happening please?

<referenceContainer name="header.panel">
  <block class="Magento\Framework\View\Element\Html\Links" name="CUSTOMER-ACCOUNT-LOGIN">
    <arguments>
      <argument name="css_class" xsi:type="string">header links</argument>
    </arguments>
  </block>
</referenceContainer>