laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.05k stars 76 forks source link

Application crashes if an app of type string was not provided #111

Closed samuelrac closed 5 months ago

samuelrac commented 5 months ago

Reverb Version

1.0.0-beta4

Laravel Version

11

PHP Version

8.2

Description

Sometimes I'm getting this error:

  Laravel\Reverb\ConfigApplicationProvider::findById(): Argument #1 ($id) must be of type string, null given, called in /Users/samuelrac/stack/whatscompany/grp_ipchat/ipchat-websocket-server/vendor/laravel/reverb/src/ConfigApplicationProvider.php on line 27

  at vendor/laravel/reverb/src/ConfigApplicationProvider.php:36
     32▕      * Find an application instance by ID.
     33▕      *
     34▕      * @throws \Laravel\Reverb\Exceptions\InvalidApplication
     35▕      */
  ➜  36▕     public function findById(string $id): Application
     37▕     {
     38▕         return $this->find('app_id', $id);
     39▕     }
     40▕ 

      +1 vendor frames 

  2   [internal]:0
      Laravel\Reverb\ConfigApplicationProvider::Laravel\Reverb\{closure}()
      +18 vendor frames 

  21  [internal]:0
      React\EventLoop\ExtEvLoop::React\EventLoop\{closure}()

After that, the application needs to be started again

Steps To Reproduce

The problem is intermittent, so I don't know what is causing this problem.

driesvints commented 5 months ago

Seems to be the same as https://github.com/laravel/reverb/issues/90. Did you add the env variables like the OP of that issue said?

driesvints commented 5 months ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.