skip to Main Content

I’m facing a strange issue while deploying a Laravel project with Filament. Everything works perfectly on my local environment (Windows), but when I move the code to my production server (Ubuntu), I get the following error:

Class "FilamentFormsComponentsFieldSet" not found

The weird thing is that this works flawlessly on my local machine. I’ve double-checked the case sensitivity of the files, and the composer install command was run on the server after deployment.

Here are the details:

Local machine: Windows 11
Server: Ubuntu 20.04
Laravel version: 11
Filament version: 3.2
Any ideas on what might be causing this?
Composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "althinect/filament-spatie-roles-permissions": "^2.2",
        "arbermustafa/filament-locationpickr-field": "2.0.0",
        "awcodes/filament-quick-create": "^3.4",
        "bezhansalleh/filament-language-switch": "^3.1",
        "bezhansalleh/filament-shield": "^3.2",
        "blade-ui-kit/blade-heroicons": "^2.4",
        "filament/filament": "^3.2",
        "laravel/framework": "^11.9",
        "laravel/sanctum": "^4.0",
        "laravel/tinker": "^2.9",
        "malzariey/filament-daterangepicker-filter": "^3.0",
        "outhebox/blade-flags": "^1.5",
        "propaganistas/laravel-phone": "^5.3",
        "solution-forest/filament-access-management": "^2.2",
        "spatie/laravel-permission": "^6.9",
        "spatie/laravel-translatable": "^6.8",
        "ysfkaya/filament-phone-input": "^3.1"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi",
            "@php artisan filament:upgrade"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r "file_exists('.env') || copy('.env.example', '.env');""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r "file_exists('database/database.sqlite') || touch('database/database.sqlite');"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Thanks in advance!

Here’s what I’ve already tried, but the issue persists:

Deleted the vendor folder and ran composer install again.
Deleted the entire project folder, did a fresh git clone, and ran the installation steps.
Tested the same code on another Windows machine, and it worked fine.
Set the folder permissions to 755 and the owner to www-data:www-data
I’ve tried clearing caches (php artisan config:clear, php artisan cache:clear, etc.), but the issue persists. I’m not sure if it’s related to the OS differences or something else.

2

Answers


  1. Chosen as BEST ANSWER

    I'h solved it, I wrote FieldSet instead of Fieldset but how it works on local and didn't work on Server.


  2. I have identified the issue, which can be resolved by comparing the versions. You are currently using a version greater than 3, which requires the use of a lowercase ‘s’ in Fieldset instead of FieldSet:

    https://filamentphp.com/docs/3.x/forms/layout/fieldset
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search