Theme layout update file is not valid after changing to developer mode
-
17-01-2021 - |
Pergunta
After i changed my site to developer mode, i got this error while trying to access backend module:
1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Theme layout update file '/var/www/project/app/code/Namespace/Module/view/adminhtml/layout/adminhtml_system_config_edit.xml' is not valid. Premature end of data in tag page line 3 Line: 7
/var/www/project/app/code/Namespace/Module/view/adminhtml/layout/adminhtml_system_config_edit.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<css src="jquery/colorpicker/css/colorpicker.css"/>
</head>
Solução
I think missing page tag close
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<head>
<css src="jquery/colorpicker/css/colorpicker.css"/>
</head>
</page>
Outras dicas
Use the below code for your layout file:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="jquery/colorpicker/css/colorpicker.css"/>
</head>
</page>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange