A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
1 of 2

The attribute 'cachable' is not allowed. Magento 2

I am facing the error in Magento Localhost which is

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /var/www/html/magento/app/code/Mb/Customizations/etc/frontend/events.xml: Element 'event', attribute 'cachable': The attribute 'cachable' is not allowed. Line: 9

In the image you can see the error enter image description here

So after That I tried to remove cacheable from the core class magento/app/code/Mb/Customizations/etc/frontend/events.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

    <event name="layout_generate_blocks_after">
        <observer name="cust_productCanonical" instance="Mb\Customizations\Observer\ProductCanonical"/>

    <event name="controller_action_predispatch_checkout_index_index" cachable="false">
        <observer name="checkcout_page_pre" instance="Mb\Customizations\Observer\Preloadtab" />
    <event name="controller_action_postdispatch_checkout_index_index" cachable="false">
        <observer name="checkcout_page_post" instance="Mb\Customizations\Observer\Loadtab" />


but after removing the casheable from the above xml file it gives me some else error

1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid XML in file /var/www/html/magento/app/code/TM/Crm/etc/frontend/events.xml: Element 'config': Missing child element(s). Expected is ( event ). Line: 2

enter image description here

So how can I remove this error and what is the problem in the above xml file. Thanks