2

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.

2 Answers 2

3

The node 'css' should be wrapped inside 'head' as below.

<head>
    <css src="Lof_All::css/fix_magento2.css" />
</head>

Check File:

(assuming the theme is within app/design/frontend/)

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

Check DB/Admin:

Check admin Layout XML Update: any <css/meta/link...>content outside ..

2
  • Fixed the issue and issue on the LOF module. thanks for ur input. Commented Nov 15, 2019 at 8:00
  • This is helpful :) Commented Mar 10, 2020 at 5:35
1

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/

3
  • Hi Naveed , i have found 4 css nodes then what should i do next step ? Can u pls help me out. Commented Oct 15, 2018 at 12:54
  • update your question with that resulted code / record. Commented Oct 15, 2018 at 13:00
  • Fixed the issue and issue on the LOF module. thanks for ur input. Commented Nov 15, 2019 at 8:00

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.