beyondcode / invoker-community

74 stars 2 forks source link

Error on opening my project: How to debug this? #285

Closed ahoiroman closed 1 year ago

ahoiroman commented 2 years ago

OS: darwin Invoker Version: 2.9.0 Laravel Version: 9.5.1 Local project: true PHP Binary: /opt/homebrew/bin/php Route: /project/placeholder?project=local-d4tXFtyAvJZYLdo3QE3kKi

Error:

AssertionError 

  assert($parameterType instanceof \ReflectionNamedType || $parameterType === null)

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/roave/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php:332
    328▕         if ($parameterReflection->isPassedByReference()) {
    329▕             $parameterNode->makeByRef();
    330▕         }
    331▕         $parameterType = $parameterReflection->getType();
  ➜ 332▕         \assert($parameterType instanceof \ReflectionNamedType || $parameterType === null);
    333▕         if ($parameterReflection->getType() !== null) {
    334▕             $parameterNode->setType($this->formatType($parameterType));
    335▕         }
    336▕         return $parameterNode;

      +13 vendor frames 
  14  [internal]:0
      _HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\ReflectionClass::_HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\{closure}(Object(_HumbugBoxf4b902e0e9ad\PhpParser\Node\Name\FullyQualified))

      +2 vendor frames 
  17  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/ModelLookupService.php:159
      _HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\ReflectionClass::getTraitNames()

As I have no clue on which part of my Laravel app this is happening, I'd need assistance in debugging here.

Thanks a lot!

mechelon commented 2 years ago

Which PHP version are you using?

ahoiroman commented 2 years ago

8.1. but it also happens with 8.0

mpociot commented 1 year ago

This error will be gone in the next Invoker version.