首页 > 解决方案 > 将模式从默认更改为开发人员收到错误

问题描述

我刚刚将我们的 magento2.3.3 模式从默认模式更改为开发人员模式

bin/magento deploy:mode:set developer

我收到错误如何解决它任何人都可以请你帮助我。?

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'container', attribute 'cacheable': The attribute 'cacheable' is not allowed.
Line: 738

Element 'block', attribute 'type': The attribute 'type' is not allowed.
Line: 890

Element 'referenceContainer', attribute 'after': The attribute 'after' is not allowed.
Line: 938


Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'container', attribute 'cacheable': The attribute 'cacheable' is not allowed.
Line: 738

Element 'block', attribute 'type': The attribute 'type' is not allowed.
Line: 890

Element 'referenceContainer', attribute 'after': The attribute 'after' is not allowed.
Line: 938

<pre>#1 Magento\Framework\Config\Dom->__construct('<layout xmlns:xs...', &Magento\Framework\App\Arguments\ValidationState#000000007ffc9088000000006ff6f5f3#, array(), NULL, '/srv/users/serve...', '%message%\nLine: ...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116]
    </pre>

标签: magentomagento2magento-2.3

解决方案


看来,您已从较低版本升级到 2.3.3。基本上这些是 xml 错误,因为您当前的 magento 版本不支持这些错误。您需要检查您的 xml 并从您的 xml 文件中更改属性“类型”。

例子:-

<block type=""> to <block class="">

之后使用这些命令

  1. php bin/magento 设置:升级
  2. php bin/magento 缓存:刷新

推荐阅读