Skip to content

Composer: require vs. require-dev #75

@BlackbitDevs

Description

@BlackbitDevs

Normally we do live deployments by executing composer install --no-dev because dev-dependencies are usually only libraries which are necessary for development. But as https://github.com/shopware/production/blob/f0743091340d2b24f86eaf53617ce17a620b4a14/composer.json#L24 gets executed when doing composer install --no-dev the script outputs Class 'Symfony\Component\Stopwatch\Stopwatch' not found and also shopware is not accessible anymore afterwards when calling the main frontend page in the browser:

[2020-12-07 15:00:14] php.CRITICAL: Uncaught Error: Class 'Symfony\Component\Stopwatch\Stopwatch' not found {"exception":"[object] (Error(code: 0): Class 'Symfony\\Component\\Stopwatch\\Stopwatch' not found at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php:12914)"} []
[2020-12-07 15:00:20] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "Stopwatch" from namespace "Symfony\Component\Stopwatch". Did you forget a "use" statement for another namespace?" at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php line 12914 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\ClassNotFoundError(code: 0): Attempted to load class \"Stopwatch\" from namespace \"Symfony\\Component\\Stopwatch\".\nDid you forget a \"use\" statement for another namespace? at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php:12914)"} []
[2020-12-07 15:00:20] php.CRITICAL: Uncaught Error: Argument 2 passed to Shopware\Core\System\SalesChannel\Context\SalesChannelContextService::get() must be of the type string, null given, called in /var/www/clients/client1/web5/web/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php on line 297 {"exception":"[object] (TypeError(code: 0): Argument 2 passed to Shopware\\Core\\System\\SalesChannel\\Context\\SalesChannelContextService::get() must be of the type string, null given, called in /var/www/clients/client1/web5/web/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php on line 297 at /var/www/clients/client1/web5/web/vendor/shopware/core/System/SalesChannel/Context/SalesChannelContextService.php:65)"} []

So it seems to me that some dependencies which are currently in require-dev are actually necessary not only for development but also for running a shopware application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions