On cart page I am getting this error in console:

Failed to load the "Magento_GiftMessage/js/view/gift-message" component

When I disable the module Magento_GiftMessage is working but it effect some where.

  • have you override this js file in your theme? Oct 1, 2019 at 8:14
  • no. I'm not override the file Oct 1, 2019 at 9:08
  • write proper description then only someone can help you else everyone open a tag to close this question. Oct 1, 2019 at 9:11
  • updated the question Oct 1, 2019 at 9:26
  • Due to Some of your custom module it is getting error, don't disable Magento_GiftMessage, enable it and try to check your custom module disable one by one Oct 1, 2019 at 11:27

3 Answers 3


Add below code in your checkout_cart_index.xml file.

<referenceContainer name="content">
            <block class="Magento\GiftMessage\Block\Cart\GiftOptions" name="checkout.cart.order.actions.gift_options" template="Magento_GiftMessage::cart/gift_options.phtml" cacheable="false">
                    <argument name="jsLayout" xsi:type="array">
                        <item name="types" xsi:type="array"/>
                        <item name="components" xsi:type="array">
                            <item name="giftOptionsCart" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_GiftMessage/js/view/gift-message</item>
                                <item name="config" xsi:type="array">
                                    <item name="template" xsi:type="string">Magento_GiftMessage/gift-message</item>
                                    <item name="formTemplate" xsi:type="string">Magento_GiftMessage/gift-message-form</item>

I had checkout_cart_index.xml copied to my theme folder and which was causing the issue, upon removing the file from theme folder it removed the error. Just copy the components from vendor to theme checkout_cart_index.xml which require changes.


I removed my checkout_cart_index.xml file from my theme folder and it fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.