Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rezuankassim's avatar

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} [] []

Can anyone help me?

0 likes
9 replies
Sinnbeck's avatar

Can you follow the stack trace to see where the error originates? There should be a file and line

rezuankassim's avatar

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?

Sinnbeck's avatar

Can you trigger the error locally? My best bet is that it is somewhere in your views. You can try searching them for getBaseName

rezuankassim's avatar

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

rezuankassim's avatar

Im sorry for the late reply.

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

jlrdw's avatar

You should really consider upgrading laravel / framework also.

rezuankassim's avatar

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 !

Please or to participate in this conversation.