I migrated M1 data to M2 using ubertheme data migration pro. When I install a theme to my site and load the home page, I am getting the following exception:

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value 'about-us' is not accepted by the pattern '[A-Z][_a-zA-Z\d](\[A-Z][_a-zA-Z\d])*'. Line: 710

  • did you get a solution? – Mohit Rane Aug 8 '19 at 14:08

In my case there was a blank space

<block class=" test\test\Block\Adminhtml\Datacheck" name='dataimprortblock' template="test::dataimport.phtml"/>

class name was having blank space before start

" test\test\Block\Adminhtml\Datacheck"

After removing the blank space the class name


That fixed in my case


Hey You can go through below link for solution:

How to fixElement block,attribute,class

if you find this answer helpful please mark it as solution or upvote thanks.

  • Hi Shubham, can you please help me locate this file; where I need to go make the change? – Gok Sep 26 '18 at 6:59
  • I am not sure still can you check "Magento\Framework\Config\Dom\ValidationException" and "magento/framework/View/Element/Template/File/Validator.php" these two files because they are basically use to validate the files. – Shubham Khandelwal Sep 26 '18 at 7:11
  • "Magento\Framework\Config\Dom\ValidationException" has nothing other than 'namespace Magento\Framework\Config\Dom; /** * @api */ class ValidationException extends \InvalidArgumentException { }' What should I look for inside "magento/framework/View/Element/Template/File/Validator.php" in particular? – Gok Sep 26 '18 at 8:28

This error showed up to me when I created a custom block. The class attribute value was correct, there was no space or slash at the beginning, but the error was still happening.

After a lot of time, I finally figured out my module namespace was not following Magento pattern.

Apparently, the first letter for Magento modules / namespaces must be uppercase, or some weird errors start happening (as was my case).

So I changed my custom module from vendor/Module to Vendor/Module and it worked :D

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.