Lumen-framework: Updating Lumen to v5.5.2 throws ErrorException in ServiceProvider

Created on 17 Oct 2017  路  10Comments  路  Source: laravel/lumen-framework

  • Lumen Version: 5.5.2
  • PHP Version: 7.1.10
  • Database Driver & Version: MySQL 14.14

Description:

After updating Lumen to version 5.5.2 and trying to visit my site (using homestead) the following error is thrown:

Invalid argument supplied for foreach()

in ServiceProvider.php (line 84)

at Application->Laravel\Lumen\Concerns\{closure}(2, 'Invalid argument supplied for foreach()', '.../vendor/illuminate/support/ServiceProvider.php', 84, array('path' => '.../vendor/illuminate/pagination/resources/views', 'namespace' => 'pagination'))

at ServiceProvider->loadViewsFrom('.../vendor/illuminate/pagination/resources/views', 'pagination')
in PaginationServiceProvider.php (line 16)

at PaginationServiceProvider->boot()

...

Most helpful comment

Someone has issued a pull request here - https://github.com/illuminate/support/pull/56

Hopefully it gets merged soon!

All 10 comments

same

(1/1)聽ErrorExceptionInvalid argument supplied for foreach()

in聽ServiceProvider.php聽(line 84)
at聽Application->Laravel\Lumen\Concerns{closure}(2, 'Invalid argument supplied for foreach()', '/data/projects/live/vendor/illuminate/support/ServiceProvider.php', 84,聽array('path' => '/data/projects/live/vendor/illuminate/pagination/resources/views', 'namespace' => 'pagination'))in聽ServiceProvider.php聽(line 84)
at聽ServiceProvider->loadViewsFrom('/data/projects/live/vendor/illuminate/pagination/resources/views', 'pagination')in聽PaginationServiceProvider.php聽(line 16)
at聽PaginationServiceProvider->boot()
at聽call_user_func_array(array(object(PaginationServiceProvider), 'boot'),聽array())in聽BoundMethod.php聽(line 29)
at聽BoundMethod::Illuminate\Container{closure}()in聽BoundMethod.php聽(line 87)
at聽BoundMethod::callBoundMethod(object(Application),聽array(object(PaginationServiceProvider), 'boot'),聽object(Closure))in聽BoundMethod.php聽(line 31)
at聽BoundMethod::call(object(Application),聽array(object(PaginationServiceProvider), 'boot'),聽array(),聽null)in聽Container.php聽(line 549)
at聽Container->call(array(object(PaginationServiceProvider), 'boot'))in聽Application.php聽(line 197)
at聽Application->register(object(PaginationServiceProvider))in聽Application.php聽(line 586)
at聽Application->loadComponent('database',聽array('Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider'), 'db')in聽Application.php聽(line 334)
at聽Application->Laravel\Lumen{closure}(object(Application),聽array())in聽Container.php聽(line 749)
at聽Container->build(object(Closure))in聽Container.php聽(line 631)
at聽Container->resolve('db',聽array())in聽Container.php聽(line 586)
at聽Container->make('db',聽array())in聽Application.php聽(line 230)
at聽Application->make('db')in聽Application.php聽(line 698)
at聽Application->withEloquent()in聽app.php聽(line 28)
at聽require('/data/projects/live/bootstrap/app.php')in聽index.php聽(line 14)

For anyone needing a temporary fix; I've managed to get everything up and running again by commenting out line 16 of PaginationServiceProvider in vendor/illuminate/pagination/PaginationServiceProvider.php

I get the same error,

Interim Fix

$app->configure('view'); 
// before making the call to "DB"

happens even if not using DB at all :/

Someone has issued a pull request here - https://github.com/illuminate/support/pull/56

Hopefully it gets merged soon!

@michaeldzjap please, you can close the issue ?

I'm not in a position to verify if it has solved the issue for me at the moment. Not until tomorrow anyway. But if there is a hurry closing this I'm sure someone with enough repo rights can do it instead?

ok :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maglor picture maglor  路  3Comments

rmblstrp picture rmblstrp  路  5Comments

timrogers picture timrogers  路  3Comments

georgeboot picture georgeboot  路  4Comments

GGNB picture GGNB  路  5Comments