FriendsOfSymfony/FOSRestBundle

The service ".service_locator.4yDV6ZJ" has a dependency on a non-existent service "FOS\RestBundle\View\ViewHandlerInterface"

speller opened this issue · 1 comments

Here is my composer.json:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.2",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/doctrine-bundle": "^2.7",
        "doctrine/doctrine-migrations-bundle": "^3.2",
        "doctrine/orm": "^2.13",
        "easycorp/easyadmin-bundle": "^4.4",
        "friendsofsymfony/rest-bundle": "^3.4",
        "latuconsinafr/3d-bin-packager": "^1.0",
        "nelmio/api-doc-bundle": "^4.10",
        "sensio/framework-extra-bundle": "^6.2",
        "stof/doctrine-extensions-bundle": "^1.7",
        "symfony/asset": "6.2.*",
        "symfony/console": "6.2.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.2.*",
        "symfony/runtime": "6.2.*",
        "symfony/serializer": "6.2.*",
        "symfony/twig-bundle": "6.2.*",
        "symfony/uid": "6.2.*",
        "symfony/yaml": "6.2.*",
        "twig/extra-bundle": "^3.0",
        "twig/twig": "^3.0"
    },
    "config": {
        "allow-plugins": {
            "composer/package-versions-deprecated": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "6.2.*"
        }
    },
    "require-dev": {
        "phpunit/phpunit": "^9.5",
        "symfony/browser-kit": "6.2.*",
        "symfony/css-selector": "6.2.*",
        "symfony/phpunit-bridge": "^6.2",
        "symfony/stopwatch": "6.2.*",
        "symfony/web-profiler-bundle": "6.2.*"
    }
}

When I'm trying to do anything, I'm getting the following error:

$ bin/console cache:clean

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 83:

  The service ".service_locator.4yDV6ZJ" has a dependency on a non-existent service "FOS\RestBundle\View\ViewHandlerInterface".

How to fix it?

The bundle was accidentally removed from the bundles.php file. Reverting it back has fixed the issue.