Uncaught RuntimeException on laravel 6 - laravel

I am facing an error in Laravel 6. How can I solve this?
Fatal error: Uncaught RuntimeException: Directory name must not be
empty. in
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php:54
Stack trace: #0
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php(54):
RecursiveDirectoryIterator->__construct('', 4096) #1
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Finder.php(669):
Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator->__construct('',
4096, false) #2
D:\Xampp\htdocs\tolet\vendor\symfony\finder\Finder.php(571):
Symfony\Component\Finder\Finder->searchInDirectory('') #3
D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\LoadConfiguration.php(76):
Symfony\Component\Finder\Finder->getIterator() #4
D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\LoadConfiguration.php(59):
Illuminate\Foundation\Bootstrap\LoadConfiguration->getConfigurationFiles(Object(Illuminate\Foundation\Application))
#5 D:\Xampp\htdocs\tolet\vendor\laravel\framework\src\I in D:\Xampp\htdocs\tolet\vendor\symfony\finder\Iterator\RecursiveDirectoryIterator.php
on line 54

The error tells you that a directory name is empty. You will need to make sure that the directory name in use has a value. Check your configuration for directory names and see whether there is any of them not configured. Ask your teammates whether some new configuration items were added that they did not let you know about so far.
But most importantly, debug your code, at the very least log some values while you are working on this at the lines pointed out by the stack trace to find out what's missing. Once you know what's missing, just make sure it will not be missing at the next load.

Related

toastr package Fatal error: Uncaught RuntimeException: A facade root has not been set

I'm trying to use Toastr package in my application to have alerts displayed to the user. I followed the tutorial here but now I can't have access to my app; I'm having this error :
Fatal error: Uncaught RuntimeException: A facade root has not been set. in C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:234 Stack trace: #0 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(397): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #1 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(374): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #2 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(289): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #3 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(188): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpExcepti in C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 234
Any thoughts on this issue? I've followed the steps and I'm getting this error. What is wrong there.. ?
Your question is not clear. please details,
and you can add your blade # before render. example:-
#toastr()->render();

Where is the laravel error file located? or Is there a default error log in Laravel?

I'm working on a medium project -with laravel- for quite a long time now and of course I use the debugger of the framework -laravel-, but now from time to time I see the page of error but there is just "whoops something went wrong without" without any specifications for the error, and I see it a lot in ajax requests, but I just actualize the page and its gone!;
Finally the error show up again and I could see it in my terminal with the command tail down here
this is what I got
[2016-12-28 14:54:04] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\shop\tess\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:45
Stack trace:
#0 D:\shop\tess\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher(NULL, 'AES-256-CBC')
#1 D:\shop\tess\vendor\laravel\framework\src\Illuminate\Container\Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
I've found this on github it helped https://github.com/orchestral/testbench/issues/93
Make sure APP_DEBUG is set to true in your .env file
You can check the errors with the following command tail -f storage/logs/laravel.log Could be different errors

Bugsnag error when running artisan command

I got this error when trying to run my php artisan migrate on my production server...
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
I ran env on the command line and I have an env variable called BUGSNAG_API_KEY and the value of it exactly matches the key at bugsnag.com for this project.
Furthermore, I have this line in my project at ./config/bugsnag.php
'api_key' => env('BUGSNAG_API_KEY'),
Weirdly, I eventually tried the same command again (php artisan migrate) and it worked! But it's left me very unsettled as it's a production server. So I'd like to understand the problem.
Errors seem to be logging in Bugsnag as well by the way.
Try to regenerate the configuration cache with php artisan config:cache. It will use the current data from the .env file to generate a new configuration cache. This worked for me.
In case this helps anyone...
The Bugsnag Git Repo mentions this issue:
(Uncaught exception 'ReflectionException' with message 'Class bugsnag.logger does not exist'
Github user GrahamCampbell suggested that what is actually happening is that another error exists, but it's "...trying to log to bugsnag which is causing this error, which is hiding the real error". I confirmed this was my issue by doing what user russianryebread suggested, which was to manually copy the bugsnag.php config file over to the Laravel /config directory. Once I did that now my real error shows:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '{'
Now to troubleshoot this issue :)
Hope this helps!

Yii 2 The directory does not exist on shared enviroment

I have problem with my web site, when i try to access it says
Fatal error: Uncaught exception
'yii\base\InvalidParamException' with message 'The directory does not exist: C:\HostingSpaces\zerguttnalog\zergutt.com'
in C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Module.php:224 Stack trace:
#0 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(358): yii\base\Module->setBasePath('C:\\HostingSpace...')
#1 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(223): yii\base\Application->setBasePath('C:\\HostingSpace...')
#2 C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Application.php(202): yii\base\Application->preInit(Array)
#3 C:\HostingSpaces\zerguttnalog\zergutt.com\wwwroot\index.php(12): yii\base\Application->__construct(Array)
#4 {main} thrown in C:\HostingSpaces\zerguttnalog\zergutt.com\vendor\yiisoft\yii2\base\Module.php on line 224.
On my local machine everything is ok (xampp on windows), i don't know what is happening on the server. Can anyone help?
Apparently you have set the base path of your application to (C:\HostingSpace..), it will work fine on your local machine because the directory exists, but on a different server yii will not find this directory.
Check your configuration files, you will fine a line starts with.
'basePath' => ... you need to change it to 'basePath' => dirname(__DIR__), and hopefully it will work fine.

Joomla - Uncaught exception, Error 500 - less block

I've migrated a Joomla site to a new server, updated the configuration.php file, and I'm getting these errors:
Fatal error: Uncaught exception 'RuntimeException' with message 'Less Parse Error: parse error: unclosed block' in
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php:1141 Stack trace: #0
/var/www/websites/alwaysevolving/templates/rt_cerulean/features/styledeclaration.php(45): Gantry->addLess('mediaqueries.le...') #1
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php(415): GantryFeatureStyleDeclaration->init() #2
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(289): Gantry->initTemplate() #3
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(439): gantry_template_initialize() #4
/var/www/websites/alwaysevolving/templates/rt_cerulean/lib/gantry/gantry.php(21): include('/var/www/websit...') #5
/var/www/websites/alwaysevolving/templates/rt_cerulean/index.php(15): require_once('/var/www/websit...') #6
/var/www/websites/alwaysevolving/libraries/joomla/document/html/html.php(531): require('/var/www/websit...') #7
/var/www/websites/alwaysevolving/libraries/joomla/do in /var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php on line 1141
It looks like there's a problem parsing one of the less files, but:
I can't tell which one of the less files has the issue
The less files were fine on the other server
The site seems fine, so it seems like something in this template doesn't like my new server.
Thoughts??
Thanks!
The error message is a stack trace, but looking at it, it appears that the Gantry framework parsing the less file called mediaqueries.less.
I strongly believe that you have forgetten to close braces }. make sure to check the line number will help you resolve the issue.

Resources