Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixtures get loaded on composer install --env=prod --no-dev #397

Open
neumanniTech opened this issue Oct 10, 2023 · 0 comments
Open

Fixtures get loaded on composer install --env=prod --no-dev #397

neumanniTech opened this issue Oct 10, 2023 · 0 comments

Comments

@neumanniTech
Copy link

Hello,
we have the following problem with the DoctrineFixturesBundle when we want to install our project on our live server.
When we run for example composer install --env=prod --no-dev and after this the cache:clear script in composer.json gets executed we get the following error:

Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!!   // Clearing the cache for the prod environment with debug false
!!
!!  In AbstractRecursivePass.php line 179:
!!                                                                                                                                                            
!!    Invalid service "App\DataFixtures\AppFixtures": class "Doctrine\Bundle\FixturesBundle\Fixture" not found while loading "App\DataFixtures\AppFixtures".  
!!                                                                                                                                                            
!!
!!  cache:clear [--no-warmup] [--no-optional-warmers]
!!
!!
Script @auto-scripts was called via post-install-cmd

Our composer.json

 {
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "cuyz/valinor-bundle": "^0.2.1",
        "doctrine/doctrine-bundle": "^2.10",
        "doctrine/doctrine-migrations-bundle": "^3.2",
        "doctrine/orm": "^2.16",
        "knpuniversity/oauth2-client-bundle": "^2.15",
        "phpdocumentor/reflection-docblock": "^5.3",
        "phpoffice/phpword": "^1.1",
        "phpstan/phpdoc-parser": "^1.24",
        "stof/doctrine-extensions-bundle": "^1.8",
        "symfony/asset": "6.3.*",
        "symfony/console": "6.3.*",
        "symfony/doctrine-messenger": "6.3.*",
        "symfony/dotenv": "6.3.*",
        "symfony/expression-language": "6.3.*",
        "symfony/flex": "^2",
        "symfony/form": "6.3.*",
        "symfony/framework-bundle": "6.3.*",
        "symfony/http-client": "6.3.*",
        "symfony/intl": "6.3.*",
        "symfony/mailer": "6.3.*",
        "symfony/mime": "6.3.*",
        "symfony/monolog-bundle": "^3.0",
        "symfony/notifier": "6.3.*",
        "symfony/process": "6.3.*",
        "symfony/property-access": "6.3.*",
        "symfony/property-info": "6.3.*",
        "symfony/runtime": "6.3.*",
        "symfony/security-bundle": "6.3.*",
        "symfony/serializer": "6.3.*",
        "symfony/string": "6.3.*",
        "symfony/translation": "6.3.*",
        "symfony/twig-bundle": "6.3.*",
        "symfony/validator": "6.3.*",
        "symfony/web-link": "6.3.*",
        "symfony/yaml": "6.3.*",
        "thenetworg/oauth2-azure": "^2.2",
        "twig/extra-bundle": "^2.12|^3.0",
        "twig/twig": "^2.12|^3.0"
    },
    "config": {
        "allow-plugins": {
            "php-http/discovery": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "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.3.*"
        }
    },
    "require-dev": {
        "deployer/deployer": "^7.3",
        "doctrine/doctrine-fixtures-bundle": "^3.4",
        "phpunit/phpunit": "^9.5",
        "symfony/browser-kit": "6.3.*",
        "symfony/css-selector": "6.3.*",
        "symfony/debug-bundle": "6.3.*",
        "symfony/maker-bundle": "^1.0",
        "symfony/phpunit-bridge": "^6.3",
        "symfony/stopwatch": "6.3.*",
        "symfony/web-profiler-bundle": "6.3.*"
    }
}

The problem exist also when we create a fresh new symfony project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant