Return value of Spatie\Once\Backtrace::getObject() must be an instance of Spatie\Once\mixed, instance of Laravel\Nova\Http\Requests\NovaRequest returned #3187
-
Description:Return value of Spatie\Once\Backtrace::getObject() must be an instance of Spatie\Once\mixed, instance of Laravel\Nova\Http\Requests\NovaRequest returned Detailed steps to reproduce the issue on a fresh Nova installation: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
This happened to me when I was developing on my local machine with PHP 8 installed, and deployed the project to shared hosting which had PHP 7.4 installed. In fact, on my local machine If you're doing the same, I suggest to install PHP 7.* on your local machine, run |
Beta Was this translation helpful? Give feedback.
-
Or follow this step https://twitter.com/themsaid/status/1341715935741284353?s=20 |
Beta Was this translation helpful? Give feedback.
-
@FaridAghili thanks a lot |
Beta Was this translation helpful? Give feedback.
-
I can confirm that this issue appears on php 7.4, but not on php 8.0. I have latest versions of Laravel and Nova. In order to reproduce just install empty Laravel project from scratch and add Nova via Composer. Hope it helps. |
Beta Was this translation helpful? Give feedback.
-
@seobrain unable to reproduce. CleanShot.2021-01-18.at.09.24.04.mp4function replicate-nova-issue() {
valet use [email protected]
cd ~/Projects/laravel/nova/issues
laravel new issue-3170
cd issue-3170
composer config repositories.local '{"type": "composer", "url": "https://nova.laravel.com"}' --file composer.json
composer require "laravel/nova:*"
composer show | grep "spatie/once"
} |
Beta Was this translation helpful? Give feedback.
This happened to me when I was developing on my local machine with PHP 8 installed, and deployed the project to shared hosting which had PHP 7.4 installed.
Notice that, I copied whole Laravel project, including
vendor
folder to remote host and didn't runcomposer install
on the remote host.In fact, on my local machine
spatie/once
v3 got installed by composer (which requires PHP 8), and PHP 8 wasn't available on my hosting.If you're doing the same, I suggest to install PHP 7.* on your local machine, run
composer update
, then deploy to server.