laravel / nova-issues

553 stars 34 forks source link

Conflict with laravel/framework & laravel/octane - Spatie/Once #6294

Closed everestmx closed 7 months ago

everestmx commented 7 months ago

Description:

Package spatie/once not installed, blocked in replace rule, maybe after this commit - https://github.com/laravel/framework/commit/45ea4093f2f9ad431d0184784a7496ce4b561b78

Detailed steps to reproduce the issue on a fresh Nova installation:

composer create-project laravel/laravel
composer require laravel/nova laravel/octane spiral/roadrunner-cli spiral/roadrunner-http
php artisan octane:install
php artisan octane:start

open in browser 127.0.0.1:8000 and see this error in log:

Class "Spatie\Once\Cache" not found

  at vendor/laravel/nova/src/NovaCoreServiceProvider.php:102
     98▕ 
     99▕             $event->listen(RequestReceived::class, function ($event) {
    100▕                 Nova::flushState();
    101▕                 /** @phpstan-ignore-next-line */
  ➜ 102▕                 Cache::getInstance()->flush();
    103▕ 
    104▕                 $event->sandbox->forgetInstance(ImpersonatesUsers::class);
    105▕             });
    106▕ 
✗ ls -Al ./vendor/spatie/once
ls: ./vendor/spatie/once: No such file or directory
✗ composer depends spatie/once
laravel/framework v11.0.7 replaces spatie/once (*)              
laravel/nova      4.33.0  requires spatie/once (^1.1|^2.0|^3.0) 
codebarista commented 7 months ago

This is fixed but not yet released: https://github.com/laravel/nova-issues/issues/6278#issuecomment-2002632583

mrtawil commented 7 months ago

@codebarista please update us when the new release is out, thank you!

rasmuscnielsen commented 7 months ago

It seems that the release is out, but I'm still getting some pretty weird issues when using Laravel Octane.

When I visit /nova/dashboards/main straight after login, I get a 404. Stopping Octane and starting again seems to work, but then visiting my User resource I consistently get 404 on metrics, cards, lenses requests.

All these has in common that it uses once() to resolve the resource. I haven't gone fully onboard in debugging it yet, but I would be surprised if it's completely unrelated as this is a completely fresh Laravel 11 + Octane + Nova installation.

image

crynobone commented 7 months ago

@rasmuscnielsen Please send new issue with all the required information and reproducing repository.