knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.58k stars 280 forks source link

HELP - Document is not generating after composer update #806

Open vimal-360 opened 4 months ago

vimal-360 commented 4 months ago

Scribe version

4.29.0

Your question

I am getting this error after composer update Nothing is changed in my code. It was generating doc before.

The following code shows an error. If I commit this. then the next route shows this error again.


Route::group(['prefix' => 'data'], function () {
    Route::get('/countries', [StaticDataController::class, 'countries']);
    Route::get('/currencies', [StaticDataController::class, 'currencies']);
})->withoutMiddleware([CoreApiMiddleware::class]);

   TypeError 

  Cannot assign Laravel\SerializableClosure\Serializers\Native to property Symfony\Component\Console\Input\InputArgument::$suggestedValues of type Closure|array

  at vendor/laravel/serializable-closure/src/Serializers/Native.php:509
    505▕                     if (is_array($value) || is_object($value)) {
    506▕                         $this->mapByReference($value);
    507▕                     }
    508▕ 
  ➜ 509▕                     $property->setValue($data, $value);
    510▕                 }
    511▕             } while ($reflection = $reflection->getParentClass());
    512▕         }
    513▕     }

  1   vendor/laravel/serializable-closure/src/Serializers/Native.php:509
      ReflectionProperty::setValue()

  2   vendor/laravel/serializable-closure/src/Serializers/Native.php:436
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  3   vendor/laravel/serializable-closure/src/Serializers/Native.php:506
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  4   vendor/laravel/serializable-closure/src/Serializers/Native.php:506
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  5   vendor/laravel/serializable-closure/src/Serializers/Native.php:436
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  6   vendor/laravel/serializable-closure/src/Serializers/Native.php:506
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  7   vendor/laravel/serializable-closure/src/Serializers/Native.php:506
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  8   vendor/laravel/serializable-closure/src/Serializers/Native.php:436
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  9   vendor/laravel/serializable-closure/src/Serializers/Native.php:506
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  10  vendor/laravel/serializable-closure/src/Serializers/Native.php:436
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  11  vendor/laravel/serializable-closure/src/Serializers/Native.php:143
      Laravel\SerializableClosure\Serializers\Native::mapByReference()

  12  [internal]:0
      Laravel\SerializableClosure\Serializers\Native::__serialize()
  13  vendor/laravel/serializable-closure/src/Serializers/Signed.php:68

  14  [internal]:0
      Laravel\SerializableClosure\Serializers\Signed::__serialize()
  15  vendor/laravel/framework/src/Illuminate/Queue/Queue.php:160

  16  vendor/laravel/framework/src/Illuminate/Queue/Queue.php:129
      Illuminate\Queue\Queue::createObjectPayload()

  17  vendor/laravel/framework/src/Illuminate/Queue/Queue.php:107
      Illuminate\Queue\Queue::createPayloadArray()

  18  vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php:38
      Illuminate\Queue\Queue::createPayload()

  19  vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:254
      Illuminate\Queue\SyncQueue::push()

  20  vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:230
      Illuminate\Bus\Dispatcher::pushCommandToQueue()

  21  vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:95
      Illuminate\Bus\Dispatcher::dispatchToQueue()

  22  vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:267
      Illuminate\Bus\Dispatcher::dispatchSync()

  23  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Illuminate\Bus\Dispatcher::Illuminate\Bus\{closure}()

  24  vendor/laravel/framework/src/Illuminate/Container/Util.php:41
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  25  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:81
      Illuminate\Container\Util::unwrapIfClosure()

  26  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod()

  27  vendor/laravel/framework/src/Illuminate/Container/Container.php:662
      Illuminate\Container\BoundMethod::call()

  28  vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1274
      Illuminate\Container\Container::call()

  29  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:220
      Illuminate\Foundation\Application::terminate()

  30  artisan:51
      Illuminate\Foundation\Console\Kernel::terminate()

Docs

shalvah commented 4 months ago

Seems like that's a bug or other change in Laravel?

vimal-360 commented 4 months ago

Error is not suggesting any of my code to look. What should I do? My production environment is not generating API doc for mobile developers :)

codespearhead commented 4 months ago

Pin down what dependency's update caused the bug, then give us the link to a MRE so we can take a look.