Failed Deployment: Class "Mockery" not found

Hi, I am deploying by building a Docker Image and pulling that after successful building on my server into a docker-compose setup. When my pipelines tries to pull that image it says:
$ docker-compose exec app php artisan storage:link && docker-compose exec app php artisan cache:clear

In SupportFileUploads.php line 17:

Class "Mockery" not found
$ docker-compose exec app php artisan storage:link && docker-compose exec app php artisan cache:clear

In SupportFileUploads.php line 17:

Class "Mockery" not found
7 Replies
alexanderkroneis
alexanderkroneisβ€’10mo ago
I am using this Dockerfile for multiple Laravel applications, e.g. Inertia + Vue, Statamic, APIs, ...
Dennis Koch
Dennis Kochβ€’10mo ago
Sounds like that trait is using Mockery which might be a dev dependency?
alexanderkroneis
alexanderkroneisβ€’10mo ago
I never heard of that trait, is that Livewire or Filament specific?
Dennis Koch
Dennis Kochβ€’10mo ago
Me neither. But it's probably one of those. How to tell with just a single line πŸ˜…
Hiz
Hizβ€’10mo ago
I just encountered this issue. This is a Livewire 3 specific issue. In the SupportFileUploads.php file, there is a function that checks if the environment your app is running in is a "testing" environment. If this is the case, it will make use of the Mockery class. In our case, we had an environment named "testing" and we just changed it to "test" in our .env, and it ran without any problems.
Remi Hindriks
Remi Hindriksβ€’4mo ago
Hi Hiz, could you explain a bit clearer what you did to fix this? We're running in to the same issue
Hiz
Hizβ€’3mo ago
Hi, We have 3 applications running on different servers. "Testing", "Acceptation" and "Production". On our testing server we have in our .env file the following:
APP_NAME=OurApp
APP_ENV=testing
APP_KEY=key
APP_DEBUG=false

# ... other .env stuff
APP_NAME=OurApp
APP_ENV=testing
APP_KEY=key
APP_DEBUG=false

# ... other .env stuff
And I simply renamed "testing" to "test" for APP_ENV
APP_ENV=test

# ... other .env stuff
APP_ENV=test

# ... other .env stuff
This resolved our issue.
Want results from more Discord servers?
Add your server
More Posts
File uploads correctly but when trying in view throws 404Hello. I suppose I may be missing something very basic, but I cannot find the solution. I am using Why this RepeatableEntry code doesn't work as expected```php public function conversationsList(Infolist $infolist): Infolist { $user = User::fMulti tenancy - Select relationship() - Searchable() remove tenant information when clicked```php Forms\Components\Select::make('client_id') ->relationship('client', 'nameTextInput Column Save with ConfirmationHi. I am using Filament v3 Table TextInput Column. When I take cursor away from it , it autosaves thNested relationshipsHi, I am working on a client project which has a few nested relationships. E.g. `Season Group` contaHow to query data from 20+ tables and pass it as a single variable to a View: UNION? JOIN?Laravel/Filament V2 First Time Project Imagine something like this: Table 1 "Company" columns: id,How can I change the font-size of heading in Apexchart in my Filament project?I tried something like this... works fine but it give me 2 headings, first with h2 and another with Set default checkboxlist valueCan someone give me example how to have a checkboxlist with default value? i've tried this, but it'AttachAction :use the same modal form for the Edit action in a relationsmanagerMy IngredientsRelationManager is working attaching records to the pivot table recipe_ingredient, buFileUploadAfter Uploading a image using Fileupload the preview of image not loading , iam getting an error..Th