Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script

We have the below contents on composer.json with dependencies and scripts. This comes from a legacy project where the vendors directory was pushed to GitHub. We’re trying to remove that vendors directory from the repository to make its creation a part of the build process.

{
    "name": "root/my-portal",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "AppBundle": "src/AppBundle"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests": "tests/"
        },
        "files": [
            "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
        ]
    },
    "require": {
        "php": ">=7.2.1",
        "doctrine/doctrine-bundle": "^2.0",
        "doctrine/orm": "^2.6",
        "incenteev/composer-parameter-handler": "~2.0",
        "psr/simple-cache": "^1.0",
        "sensio/framework-extra-bundle": "^5.5",
        "symfony/monolog-bundle": "^3.4",
        "symfony/polyfill-apcu": "^1.2",
        "symfony/swiftmailer-bundle": "^3.4.0",
        "symfony/symfony": "^4.4"
    },
    "require-dev": {
        "symfony/phpunit-bridge": "^4.0"
    },
    "scripts": {
        "symfony-scripts": [
            "IncenteevParameterHandlerScriptHandler::buildParameters",
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile",
            "SensioBundleDistributionBundleComposerScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "config": {
        "sort-packages": true
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": null
    }
}

But on a "clean" install of this project, i.e. removing the vendors directory and the composer.lock file before running composer install or composer update, everything seems to work, except for the Sensio part:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 43 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.4.2): Downloading (100%)
  - Installing psr/container (1.0.0): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing symfony/contracts (v1.1.10): Downloading (100%)
  - Installing symfony/polyfill-php80 (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-php73 (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.18.1): Downloading (100%)
  - Installing paragonie/random_compat (v9.99.99): Downloading (100%)
  - Installing symfony/polyfill-php70 (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-intl-normalizer (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-intl-idn (v1.18.1): Downloading (100%)
  - Installing symfony/polyfill-intl-icu (v1.18.1): Downloading (100%)
  - Installing symfony/symfony (v4.4.14): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.18.1): Downloading (100%)
  - Installing psr/log (1.1.3): Downloading (100%)
  - Installing psr/link (1.0.0): Loading from cache
  - Installing twig/twig (v3.0.5): Downloading (100%)
  - Installing doctrine/lexer (1.2.1): Downloading (100%)
  - Installing doctrine/annotations (1.10.4): Downloading (100%)
  - Installing doctrine/reflection (1.2.1): Downloading (100%)
  - Installing doctrine/event-manager (1.1.1): Downloading (100%)
  - Installing doctrine/collections (1.6.7): Downloading (100%)
  - Installing doctrine/cache (1.10.2): Downloading (100%)
  - Installing doctrine/persistence (2.0.0): Downloading (100%)
  - Installing symfony/polyfill-apcu (v1.18.1): Downloading (100%)
  - Installing psr/simple-cache (1.0.1): Loading from cache
  - Installing doctrine/sql-formatter (1.1.1): Downloading (100%)
  - Installing doctrine/dbal (2.10.4): Downloading (100%)
  - Installing doctrine/doctrine-bundle (2.1.2): Downloading (100%)
  - Installing doctrine/instantiator (1.3.1): Downloading (100%)
  - Installing doctrine/inflector (1.4.3): Downloading (100%)
  - Installing doctrine/common (3.0.2): Downloading (100%)
  - Installing doctrine/orm (v2.7.3): Downloading (100%)
  - Installing incenteev/composer-parameter-handler (v2.1.4): Downloading (100%)
  - Installing sensio/framework-extra-bundle (v5.6.1): Downloading (100%)
  - Installing monolog/monolog (1.25.5): Downloading (100%)
  - Installing symfony/monolog-bundle (v3.5.0): Loading from cache
  - Installing symfony/polyfill-iconv (v1.18.1): Downloading (100%)
  - Installing egulias/email-validator (2.1.22): Downloading (100%)
  - Installing swiftmailer/swiftmailer (v6.2.3): Loading from cache
  - Installing symfony/swiftmailer-bundle (v3.5.0): Downloading (100%)
  - Installing symfony/phpunit-bridge (v4.4.14): Downloading (100%)
symfony/contracts suggests installing symfony/cache-implementation
symfony/contracts suggests installing symfony/event-dispatcher-implementation
symfony/contracts suggests installing symfony/http-client-implementation
symfony/contracts suggests installing symfony/service-implementation
symfony/contracts suggests installing symfony/translation-implementation
symfony/contracts suggests installing psr/event-dispatcher (When using the EventDispatcher contracts)
symfony/polyfill-mbstring suggests installing ext-mbstring (For best performance)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/polyfill-intl-normalizer suggests installing ext-intl (For best performance)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/polyfill-intl-icu suggests installing ext-intl (For best performance)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
swiftmailer/swiftmailer suggests installing ext-intl (Needed to support internationalized email addresses)
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
Writing lock file
Generating autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> IncenteevParameterHandlerScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script

And we can’t find what could be wrong here. Any ideas?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *