I'll try to help you debug here.
Firstly, let's revert your change in line 171.
Then try to remove generated
directory and cache directories too and run bin/magento setup:upgrade
to make sure that anything related to this issue is cleared:
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf generated/*
bin/magento setup:upgrade
And recompile code with verbose argument:
bin/magento setup:di:compile -vvv
If the issue still persists, let's open setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php
, and edit line 125 to dump the value of $configuredArgument
variable which passes to
getConfiguredInstanceArgument(array $config)
method - line 171
Replace
$argument = $this->getConfiguredInstanceArgument($configuredArgument);
with
var_dump($configuredArgument);
$argument = $this->getConfiguredInstanceArgument($configuredArgument);
Run bin/magento setup:di:compile
and check the result, if it's long lines result, paste it somewhere which allows sharing long lines of code like pastebin, and share it here.
If it works properly, it should output something similar to this:
Compilation was started.
Area configuration aggregation... 5/9 [===============>------------] 55% 39 secs 390.0 MiBarray(1) {
["instance"]=>
string(40) "Magento\Framework\Filesystem\Driver\File"
}
array(1) {
["instance"]=>
string(37) "Magento\Backend\Block\MenuItemChecker"
}
array(1) {
["instance"]=>
string(36) "Magento\Backend\Block\AnchorRenderer"
}
array(1) {
["instance"]=>
string(46) "Magento\Config\Model\ResourceModel\Config\Data"
}
array(1) {
["instance"]=>
string(63) "Magento\Config\Model\ResourceModel\Config\Data\Collection\Proxy"
}
Update: Output from OP's command:
array(1) {
["instance"]=>
string(43) "Magento\Shipping\Model\Method\VirtualLogger"
}
array(1) {
["instance"]=>
string(46) "Magento\Config\Model\ResourceModel\Config\Data"
}
array(1) {
["instance"]=>
string(63) "Magento\Config\Model\ResourceModel\Config\Data\Collection\Proxy"
}
array(1) {
["instance"]=>
string(46) "Magento\Config\Model\ResourceModel\Config\Data"
}
array(1) {
["instance"]=>
string(63) "Magento\Config\Model\ResourceModel\Config\Data\Collection\Proxy"
}
array(1) {
["instance"]=>
string(43) "Magento\Shipping\Model\Method\VirtualLogger"
}
array(1) {
["instance"]=>
string(46) "Magento\Variable\Model\Config\StructureVirtual"
}
array(1) {
["general/imprint"]=>
array(33) {
["general/imprint/shop_name"]=>
string(1) "1"
....
}
}
Based on your output, the last item doesn't have instance
node which caused the error.
The config indicates you are using FireGento MageSetup module and I guess you are still at an older version. They reported the error for Magento 2.4.3 and fixed it 2 years ago. https://github.com/firegento/firegento-magesetup2/pull/200/files#diff-093a1e43a11122404c853506b7ca4f661e18dd4f6557ec3089cad8ceae34a606
So, to resolve your issue, edit <FireGento_MageSetup module dir>/etc/di.xml
to replace
<type name="Magento\Variable\Model\Source\Variables">
with
<type name="Magento\Variable\Model\Config\Structure\AvailableVariables">
or upgrade the FireGento MageSetup module to the latest version.
Read more about the FireGento MageSetup module at https://github.com/firegento/firegento-magesetup2
bin/magento
command to get verbose output, eg:bin/magento setup:di:compile -vvv
. And what is your PHP version?