Lumen-framework: FatalErrorException Uncaught ReflectionException: Class path.storage does not exist upon composer update

Created on 10 Aug 2018  路  8Comments  路  Source: laravel/lumen-framework

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

Description:

my old version is 5.6.29
image

Most helpful comment

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.

All 8 comments

Where does this problem occur?

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 (https://github.com/laravel/lumen-framework/issues/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

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();
});

that fix the problem, thank you so much

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.

Thanks for helping out @JacksonIV & @jordanramstad 馃憤

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();

@rendybustari please upgrade to 5.8

Was this page helpful?
0 / 5 - 0 ratings