TypeError After Updating to Ninja Invoice 5.7.30

Hello everyone,

I recently updated my Ninja Invoice to version 5.7.30. Post-update, I encountered a TypeError while running some Laravel artisan commands. Here’s the error message:

arduinoCopy code

[2023-10-18 14:53:30] production.ERROR: Illuminate\Foundation\Console\RouteCacheCommand::buildRouteCacheFile(): Argument #1 ($routes) must be of type Illuminate\Routing\RouteCollection, Illuminate\Routing\CompiledRouteCollection given, called in /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php on line 68
...

The error seems to be related to the RouteCacheCommand and its argument type, which is causing issues.

Has anyone faced this issue before, and how can it be resolved? Any help would be greatly appreciated.

Thank you!

Hi,

@david do you have any suggestions?

# artisan optimize

   INFO  Caching the framework bootstrap files.  

  config ................................................................................................................................. 25ms FAIL

   ErrorException 

  file_put_contents(/usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/bootstrap/cache/config.php): Failed to open stream: Permission denied

  at vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:205
    201▕      * @return int|bool
    202▕      */
    203▕     public function put($path, $contents, $lock = false)
    204▕     {
  ➜ 205▕         return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
    206▕     }
    207▕ 
    208▕     /**
    209▕      * Write the contents of a file, replacing it atomically if it already exists.

      +30 vendor frames 

  31  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Missed sudo :smiley:

sudo php81 artisan optimize

Passwort:

PHP Fatal error: Uncaught TypeError: Illuminate\Foundation\Console\Kernel::__construct(): Argument #2 ($events) must be of type Illuminate\Contracts\Events\Dispatcher, Illuminate\Events\Dispatcher given in /usr

/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:113

Stack trace:

#0 [internal function]: Illuminate\Foundation\Console\Kernel->__construct()

#1 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(952): ReflectionClass->newInstanceArgs()

#2 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

#3 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(937): Illuminate\Container\Container->resolve()

#4 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(297): Illuminate\Foundation\Application->resolve()

#5 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\Container\Container->Illuminate\Container\{closure}()

#6 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()

#7 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(937): Illuminate\Container\Container->resolve()

#8 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()

#9 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(922): Illuminate\Container\Container->make()

#10 /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/artisan(33): Illuminate\Foundation\Application->make()

#11 {main}

thrown in /usr/local/www/apache24/noexec/k10013/k10013_kr7d/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php on line 113

Update: I’m not sure exactly what steps led to the resolution, but everything is working as expected now. Thank you for your attention to this issue.

Glad to hear it, thanks for the update!