1

I just create a new sample theme. when i apply this theme getting this type or error

My Composer.json have this code

"name": "mytheme/theme1",
"description": "N/A",
"config": {
    "sort-packages": true
},
"require": {
    "php": "~7.1.3||~7.2.0||~7.3.0",
    "magento/theme-frontend-blank": "100.0.*",
    "magento/framework": "100.0.*"
},
"type": "magento2-theme",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"autoload": {
    "files": [
        "registration.php"
    ]
}

}

My theme.xml code:-

enter image description here

My registration.php Code

enter image description here

Can come please explain what things a do wrong in my code.

When i open Page Get This Error

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'remove': This element is not expected. Expected is one of ( attribute, block, referenceBlock, referenceContainer, container, move, uiComponent ). Line: 696

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'remove': This element is not expected. Expected is one of ( attribute, block, referenceBlock, referenceContainer, container, move, uiComponent ). Line: 696

#1 Magento\Framework\Config\Dom->__construct('createObject('Magento\Framewor...', array('create('Magento\Framewor...', array('xml' => ' '/var/www/html/ma...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#00000000227d285700000000553dfae9#)) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#4 Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewor...', array('xml' => ' '/var/www/html/ma...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#00000000227d285700000000553dfae9#)) called at [vendor/magento/framework/Config/DomFactory.php:43]
#5 Magento\Framework\Config\DomFactory->createDom(array('xml' => ' '/var/www/html/ma...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#00000000227d285700000000553dfae9#)) called at [vendor/magento/framework/View/Model/Layout/Update/Validator.php:141]
#6 Magento\Framework\View\Model\Layout\Update\Validator->isValid('_validateMergedLayout('LAYOUT_frontend_...', 'load(array()) called at [generated/code/Magento/Framework/View/Model/Layout/Merge/Interceptor.php:193]
#9 Magento\Framework\View\Model\Layout\Merge\Interceptor->load() called at [vendor/magento/framework/View/Layout/Builder.php:86]
#10 Magento\Framework\View\Layout\Builder->loadLayoutUpdates() called at [vendor/magento/framework/View/Layout/Builder.php:63]
#11 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Layout.php:253]
#12 Magento\Framework\View\Layout->build() called at [vendor/magento/framework/View/Layout.php:875]
#13 Magento\Framework\View\Layout->getBlock('page_content_hea...') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:414]
#14 Magento\Framework\View\Layout\Interceptor->getBlock('page_content_hea...') called at [vendor/magento/module-cms/Helper/Page.php:171]
#15 Magento\Cms\Helper\Page->prepareResultPage(&Magento\Cms\Controller\Index\Index\Interceptor#00000000227d2b2f00000000553dfae9#, 'home') called at [vendor/magento/module-cms/Controller/Index/Index.php:74]
#16 Magento\Cms\Controller\Index\Index->execute(NULL) called at [generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php:24]
#17 Magento\Cms\Controller\Index\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#18 Magento\Framework\App\Action\Action->dispatch(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#19 Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#20 Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#21 Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#), array(array('designLoader', 'customerNotifica...', 'catalog_app_acti...', 'tax-app-action-d...', 'weee-app-action-...', 'storeCheck', 'contextPlugin', 'customer-app-act...'))) called at [generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php:39]
#22 Magento\Cms\Controller\Index\Index\Interceptor->dispatch(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/App/FrontController.php:159]
#23 Magento\Framework\App\FrontController->processRequest(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#, &Magento\Cms\Controller\Index\Index\Interceptor#00000000227d2b2f00000000553dfae9#) called at [vendor/magento/framework/App/FrontController.php:98]
#24 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#25 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#26 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94]
#27 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(&Magento\Framework\App\FrontController\Interceptor#00000000227d281f00000000553dfae9#, &Closure#00000000227d282200000000553dfae9#, &Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#28 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73]
#29 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(&Magento\Framework\App\FrontController\Interceptor#00000000227d281f00000000553dfae9#, &Closure#00000000227d282200000000553dfae9#, &Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#30 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#31 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#), NULL) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#32 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#00000000227d29c900000000553dfae9#) called at [vendor/magento/framework/App/Http.php:136]
#33 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#34 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]
#35 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#00000000227d298700000000553dfae9#) called at [index.php:39]
  • Somewhere you use remove element please remove it and check. OR please add your code here. – Ravi Soni Jul 3 at 9:38
  • please check now i upload all code file – Mahendar Singh Jul 3 at 9:40
  • Is that all files you added here? OR Magento_Theme folder is there. If yes then please add layout XML file here which inside Magento_Theme directory – Ravi Soni Jul 3 at 9:44
  • In your custom theme, there are default.xml and default_head_blocks.xml file in Magento_Theme/layout directory. Please add code here for that both files, so we can check and give you the solutions. – Ravi Soni Jul 3 at 9:49

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.