1

The UI XML file:

app/code/NewShop/NewModule/view/frontend/layout/checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <referenceContainer name="checkout.cart.container">
      <block class="NewShop\NewModule\Block\Cart\Ui" name="newshop-newmodule-cart-ui" template="NewShop_NewModule::cart/ui.phtml" after="checkout.cart.form">
        <arguments>
          <argument name="jsLayout" xsi:type="array">
            <item name="components" xsi:type="array">
              <item name="ui" xsi:type="array">
                <item name="component" xsi:type="string">NewShop_NewModule/js/cart</item>
                <item name="config" xsi:type="array">
                  <item name="template" xsi:type="string">NewShop_NewModule/checkout/cart</item>
                </item>
              </item>
            </item>
          </argument>
        </arguments>
      </block>
    </referenceContainer>
  </body>
</page>

These are the files I'm attempting to load:

app/code/NewShop/NewModule/view/frontend/web/js/cart.js

app/code/NewShop/NewModule/view/frontend/web/template/checkout/cart.html

But I get this error in browser console:

[ERROR] Failed to load the "NewShop_NewModule/js/cart" component. 
console-output-handler.js:34

My Questions are:

  • Is there anything wrong in the XML code?
  • Is Magento 2.3 different from Magento 2.1 on how it loads the UI components?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.