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

FatalErrorException Uncaught ReflectionException: Class path.storage does not exist upon composer update #798

Closed
chrislim1914 opened this issue Aug 10, 2018 · 8 comments

Comments

@chrislim1914
Copy link

  • Lumen Version: 5.6.33
  • PHP Version: 7.1
  • Database Driver & Version:

Description:

my old version is 5.6.29
image

@jensdenies
Copy link
Contributor

Where does this problem occur?

@chrislim1914
Copy link
Author

when i try to install pragmarx/google2fa-laravel but it wont install then i try composer require --no-update pragmarx/google2fa-laravel then composer update. it install pragmarx and update my lumen to 5.6.33.
i found this issue (#504) so i try to add this on bootstrap/app.php
$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config'); $app->instance('path.storage', app()->basePath() . DIRECTORY_SEPARATOR . 'storage');

and gave me this error
image

@jensdenies
Copy link
Contributor

It seems like the ResponseFactory contract has not been bound to the Lumen implementation. Could you try to add this to a service provider? The AppServiceProvider perhaps?

$this->app->bind(\Illuminate\Contracts\Routing\ResponseFactory::class, function () {
    return new \Laravel\Lumen\Http\ResponseFactory();
});

@chrislim1914
Copy link
Author

that fix the problem, thank you so much

@felorhik
Copy link

felorhik commented Sep 4, 2018

Just a note because I got caught by this as well. You need both what @chrislim1914 found:

$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config'); 
$app->instance('path.storage', app()->basePath() . DIRECTORY_SEPARATOR . 'storage');

And what @jackmcdade suggested in the register function of AppServiceProvider:

$this->app->bind(\Illuminate\Contracts\Routing\ResponseFactory::class, function () {
    return new \Laravel\Lumen\Http\ResponseFactory();
});

To fix this issue. Also it does not seem to be tied to any specific package that I can see (I am not using pragmarx/google2fa-laravel). Also it seems be to downgrading laravel/framework from 5.6.3x to 5.6.16. But since it is happening through composer files not associated to the project, and the versions using wildcards, I cannot see a way to bypass this through downgrades.

@driesvints
Copy link
Member

Thanks for helping out @JacksonIV & @jordanramstad 👍

@rendybustari
Copy link

hi @driesvints @jordanramstad @JacksonIV , i stiil got that issue

when i run, php artisan

"Class path.config does not exist" with lumen Lumen 5.7

i already adding in bootstrap/app.php

$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');
$app->instance('path.storage', app()->basePath() . DIRECTORY_SEPARATOR . 'storage');

$app->withFacades();
$app->withEloquent();

@driesvints
Copy link
Member

@rendybustari please upgrade to 5.8

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

5 participants