首页 > 解决方案 > 为什么我在 magento 2 中的编译时出错

问题描述

setup:di:compile执行命令时出现此错误

$ php bin/magento s:d:c
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Symfony\Component\Console\Output\OutputInterface in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116
Stack trace:
#0 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Symfony\\Compone...', Array)
#1 vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Symfony\\Compone...')
#2 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Symfony\\Compone...')
#3 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\F in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116

Fatal error: Uncaught Error: Cannot instantiate interface Symfony\Component\Console\Output\OutputInterface in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116
Stack trace:
#0 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Symfony\\Compone...', Array)
#1 vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Symfony\\Compone...')
#2 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Symfony\\Compone...')
#3 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\F in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116

标签: magento2

解决方案


我的问题是由于任何自定义模块 di.xml 文件如果您的界面仍然无法加载,请检查您的 di.xml 并验证首选项是否可用。我希望您了解我想向您解释的信息检查链接抽象实现映射主题 https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/di-xml-file。 html


推荐阅读