Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 5.6 - 'ReflectionException: Class config does not exist' after registering provider in bootstrap/app.php #525

Closed
StrikeAgainst opened this issue Oct 1, 2018 · 2 comments

Comments

@StrikeAgainst
Copy link

I just tried to setup this package in my Laravel (v5.6) project, after reloading the page I got this exception trace put out:

Fatal error: Uncaught ReflectionException: Class config does not exist in /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php:767 Stack trace: #0 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php(767): ReflectionClass->__construct('config')
#1 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('config')
#2 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('config', Array)
#3 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('config', Array)
#4 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php(1210): Illuminate\Foundation\Application->make('config')
#5 /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(57): Illumin in /home/w19232/web/liebherr/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 767

which is not even represented in Laravel's usual exception UI but put out as plain string. After rolling back the setup step by step I figured out that this exception is caused by adding the line

$app->register(\Barryvdh\DomPDF\ServiceProvider::class);

into bootstrap/app.php

@StrikeAgainst
Copy link
Author

Just realized I don't need this line if I don't use Lumen. My bad!

@pavanyogi
Copy link

Don't forget to use quotes if any of your environment variables contains space eg.
APP_NAME=Laravel Learning // wrong, it will give an error
APP_NAME="Laravel Learning" // correct, in my case it solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants