5

I'm getting this error message: Missing required argument $routerList of Magento\Framework\App\RouterList.

I copied my project from my server to my local. First I believed that is the config.php file is missing, but it is there.

This is the method from where i got this error:

protected function _resolveArguments($requestedType, array $parameters, array $arguments = [])
    {
        $resolvedArguments = [];
        $arguments = count($arguments)
            ? array_replace($this->config->getArguments($requestedType), $arguments)
            : $this->config->getArguments($requestedType);
        foreach ($parameters as $parameter) {
            list($paramName, $paramType, $paramRequired, $paramDefault) = $parameter;
            $argument = null;
            if (!empty($arguments) && (isset($arguments[$paramName]) || array_key_exists($paramName, $arguments))) {
                $argument = $arguments[$paramName];
            } elseif ($paramRequired) {
                if ($paramType) {
                    $argument = ['instance' => $paramType];
                } else {
                    $this->creationStack = [];
                    throw new \BadMethodCallException(
                        'Missing required argument $' . $paramName . ' of ' . $requestedType . '.'
                    );
                }
            } else {
                $argument = $paramDefault;
            }

            $this->resolveArgument($argument, $paramType, $paramDefault, $paramName, $requestedType);

            $resolvedArguments[] = $argument;
        }
        return $resolvedArguments;
    }
11

In my env.php file from app/etc I had to change this part:

'cache_types' =>
        array (
            'config' => 1,
            'layout' => 1,
            'block_html' => 1,
            'collections' => 1,
            'reflection' => 1,
            'db_ddl' => 1,
            'eav' => 1,
            'customer_notification' => 1,
            'full_page' => 1,
            'config_integration' => 1,
            'config_integration_api' => 1,
            'translate' => 1,
            'config_webservice' => 1,
            'compiled_config' => 1,
        ),

into this:

'cache_types' =>
        array (
            'config' => 0,
            'layout' => 0,
            'block_html' => 0,
            'view_files_fallback' => 0,
            'view_files_preprocessing' => 0,
            'collections' => 0,
            'db_ddl' => 0,
            'eav' => 0,
            'full_page' => 0,
            'translate' => 0,
            'config_integration' => 0,
            'config_webservice' => 0,
            'config_integration_api' => 0,
        ),

This one, fixed my issue.

  • What this does is disable your cache. I'm not sure what the real issue was here, but that's not a good solution. – Scott Buchanan Sep 25 '18 at 16:03
1

Just run bin/magento module:enable --all to regenerate config.php, and then bin/magento setup:upgrade.

0

I have faced the similar issue and in my case, the issue was due to missing config.php in app/etc.

0

I had the same issue. In my case it was related to the cache. Instead of disabling the magento cache I run

php bin/magento cache:clean 

from the magento root directory to clean out all cache types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.