This error I randomly get every other call on my local is driving me insane.
Call to a member function implementsInterface() on null
I am using Laravel 9 with maninly Livewire, and I've only noticed it in my Livewire Ajax calls.
It seems to be related the Laravel Telescope which I disabled in .env and even removed the serviceProvider from config/app.php to no avail.
It seems to happen during only after a Livewire $emit function.
The code error happens in
staging\vendor\laravel\telescope\src\Watchers\ViewWatcher.php: 164
during:
protected function isViewComposerClosure(ReflectionFunction $closure): bool
{
return $closure->getClosureScopeClass()->implementsInterface(Factory::class) &&
array_key_exists('class', $closure->getStaticVariables());
}
I went ahead and uninstalled telescope from composer just now. I am not sure how code was getting to Telescope or if it is gonna cause a new error. It would be great to someday find an answer here. For now I it seems no telescope installed prevents the error. I am just confused as Telescope was disabled and a step further removed as a ServiceProvider.