Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to a member function getBaseName() on string in Command line code:38
Hi,
I have a laravel project which is running version 5.1, I am keep having this error message in my laravel.log file, it is keep spamming non-stop.
[2020-08-25 10:26:32] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to a member function getBaseName() on string in Command line code:38 Stack trace: #0 Command line code(61): getViews('/Users/rezuanka...', Object(Illuminate\Filesystem\Filesystem)) #1 {main} thrown in Command line code:38 Stack trace: #0 {main} [] []
I wanted to check where the error originates from but all I got from the error log is
[2020-08-25 13:59:09] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to a member function getBaseName() on string in Command line code:38 Stack trace: #0 Command line code(61): getViews('/Users/rezuanka...', Object(Illuminate\Filesystem\Filesystem)) #1 {main} thrown in Command line code:38 Stack trace: #0 {main} [] []
Is there anyway I can check where the error originates from?
I only found getBaseName in Illuminate vendor file vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php, vendor/symfony/http-foundation/File/File.php and vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php
My guess that the error is originates from some of the background code that is running for Laravel 5.1.
It is quiet annoying as I need to switch PHP version so that the project will not continue to produce the error, this is because the project only runs in PHP 7.1
According to the getBaseName in `Illuminate\Filesystem\Filesystem' this is part of moving a directory. Do you perhaps do that in some sort of scheduled job/command?
I have checked that there is no schedule job/command is running in my local. And if there is any job that is queued that could make this error to occur, I still need to run php artisan queue:listen to make that happen, but I did not run any command at all.
It will keep spamming my laravel.log file. The only way I can stop this spam is comment out return parent:report($e) in my App\Exceptions\Handler.php
Wow! How do you found out the bug? But currently it doesn't appear in my Log file anymore, if it appear again, I will try to disabled Laravel Intellisense extension in my Visual Studio code, to check whether this works. Thanks @xiaohuilam !