0

Magento version: 2.4.1

theme: codazon

when Magento is in production mode everything works fine but when I enable development mode, I can't access the product page and I got bellow error:

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'move', attribute 'before': [facet 'pattern'] The value '' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_.]*|-'. Line: 1766

Element 'move', attribute 'before': '' is not a valid value of the atomic type 'elementPositionType'. Line: 1766

#1 Magento\Framework\Config\Dom->__construct('createObject('Magento\Framewor...', array('create('Magento\Framewor...', array('xml' => ' '/var/www/html/ve...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#000000005269c0cc00000000598efc54#)) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56] #4 Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewor...', array('xml' => ' '/var/www/html/ve...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#000000005269c0cc00000000598efc54#)) called at [vendor/magento/framework/Config/DomFactory.php:43] #5 Magento\Framework\Config\DomFactory->createDom(array('xml' => ' '/var/www/html/ve...', 'validationState' => &Magento\Framework\App\Arguments\ValidationState#000000005269c0cc00000000598efc54#)) called at [vendor/magento/framework/View/Model/Layout/Update/Validator.php:142] #6 Magento\Framework\View\Model\Layout\Update\Validator->isValid('
1
  • 1
    Please wrap the error using Markdown code formatting tool.
    – Asrar
    Feb 21, 2022 at 23:59

2 Answers 2

0

Judging by the error, it might be one <move> instruction has an error in the syntax, specifically Magento is complaining on the 'before' attribute. Check all the nodes declared in your layout files, and make sure there is no issue with them. Usually, 'before' attribute has a dash or another element name as a value, like before="-" or before="element.name".

Check more details on DevDocs: https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv

0

Look like in your catalog_product_view.xml you added before in <move> tag. which one is not valid as per syntax.

so, find out and remove before="your_container".

and run php bin/magento cache:clean.

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.