Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rafa-acioly's avatar

ValueFactory in the first instantiation

When running my github action I got this error

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In ValueRegisterService.php line 63:
                                                         
  You must pass ValueFactory in the first instantiation  
                                                         

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

the artisan command and postAutoloadDump command are both inside the scripts.post-autoload-dump array

"scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ]

This error only happens on github actions

- name: Setup PHP
        uses: shivammathur/setup-php@v2
        env:
          runner: self-hosted
        with:
          php-version: '8.2'
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, mongodb
          coverage: none

      - name: Prepare Laravel Application
        run: |
          php -r "file_exists('.env') || copy('.env.example', '.env');"

      - name: Install Dependencies
        run: composer update && composer install -q --no-ansi --no-interaction --no-progress --prefer-dist

Do I need to add another config. to run it on github action?

Specs:

Laravel version: 10.10
PHP: 8.2
0 likes
0 replies

Please or to participate in this conversation.