1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected. Line: 542 facing this issue in 2.2.5.

I have upgraded from Magento 2.1.9 to Magento 2.2.5 version.

Please help me guys.


The error is showing because there is layout file which has a node. you should check your custom theme's Magento_Theme/layout/default.xml file if you have any css node, ( also check your default_heads_block.xml file if you have added any custom css file ) if you don't fine any then check layout of specific page where this error is showing.

if you are using linux / ssh ( run this command it would find and list the file where this is added / declared )

grep -r -i --include \*.xml '<css' app/design/frontend/

  • Hi Naveed , i have found 4 css nodes then what should i do next step ? Can u pls help me out. – gajjala sandeep Oct 15 '18 at 12:54
  • update your question with that resulted code / record. – Naveed Asim Oct 15 '18 at 13:00

Your Answer

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

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