Upgrading from Magento 2.1.7 to 2.2.0 PHP 7.0 MySQL 5.6

Through command line I've run these commands and had no hiccups until I looked at the front end: bin/magento maintenance:enable composer require magento/product-community-edition 2.2.0 --no-update composer update rm -rf var/cache/* rm -rf var/page_cache/* rm -rf var/generation/* chmod +x bin/magento bin/magento setup:upgrade bin/magento maintenance:disable

I get this error message, I'm new to Magento and just an ecommerce manager, I'm updating due to some vulenrabilities, if anyone can help it would be great:

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected. Line: 721

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css': This element is not expected. Line: 721

  • Please check error_log file is any plug in cause this error make it disable than check
    – Mahendra
    Commented Aug 18, 2018 at 12:34

1 Answer 1


It sounds as if there's a layout file which has a <css> node where it shouldn't be. If you're using bash/zsh, run the grep command below and it should point you in the right direction as to where <css> elements are (assuming the theme is within app/design/frontend/)

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

  • Hi Rhys, that worked great. I got rid of those errors. Thank you. I'm still battling with a couple of more errors however. :)
    – Rover11
    Commented Aug 20, 2018 at 14:54
  • @Rhys, <css> will not work in Magento 2.3.3 anymore? Commented Nov 8, 2019 at 6:02
  • <css> still works in 2.3.3 layouts but only in certain locations. i.e. it would work inside the <head> section of your layout XML file, but not under a <referenceBlock> section Commented Nov 8, 2019 at 11:59

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.