1

Tried to install a store locator extension.

When go to the front end producing this error.

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This element is not expected. Expected is one of ( title, css, link, meta, script, remove, attribute ). Line: 708

0 D:\xampp\htdocs\tork\vendor\magento\framework\Config\Dom.php(115): Magento\Framework\Config\Dom->_initDom(' 1D:\xampp\htdocs\tork\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('

How can i fix this issue?. Magento version 2.2.2

1 Answer 1

2

most probably you have in one of your layout files a <block> tag inside the <head> tag.
The <head> tag does not support block child elements.
See the xsd validation schema for head section: https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/View/Layout/etc/head.xsd#L51

If your next question is, "But I need to add a block to my head section. how do I do that?" then you can check this: Magento 2: Adding Arbitrary HTML to the <head> of Every Page?

2
  • 1
    Oh yeah....or the other way around. Didn't think this could be :)
    – Marius
    Mar 26, 2018 at 12:33
  • Element 'route': Missing child element(s). Expected is ( resources ). any help? Sep 24, 2020 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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