Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nscott's avatar

Failed to deploy on forge Class 'Illuminate\Pagination\CursorPaginator' not fou

I keep getting this error when I try to deploy my site on Forge:

Fri May 21 17:06:30 UTC 2021
From github.com:natewscott/djbath
 * branch            dev        -> FETCH_HEAD
Updating bcd4e7e..4c82b1c
Fast-forward
 composer.json                         | 12 +++++-------
 routes/web.php                        |  2 +-
 vendor/composer/InstalledVersions.php |  4 ++--
 vendor/composer/autoload_classmap.php | 10 ++--------
 vendor/composer/autoload_psr4.php     |  2 ++
 vendor/composer/autoload_static.php   | 20 ++++++++++++--------
 vendor/composer/installed.php         |  4 ++--
 7 files changed, 26 insertions(+), 28 deletions(-)
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In PaginationState.php line 37:
                                                           
  Class 'Illuminate\Pagination\CursorPaginator' not found  
                                                           

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Everything was working fine yesterday. I have run composer update and it still gives the same message. If I comment this line out, then I get a whole different error message. Any one seen this or now how to resolve it?

0 likes
1 reply
nscott's avatar

I resolved this by rolling back my git commits, but I am still not 100% sure why this error was thrown in the first place.

Please or to participate in this conversation.