© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
jelmerkeij

Livewire component has 'undefined variable' after updating Livewire?

I've setup a FormField as Livewire component in the a testing app using Filament 3 and Livewire 3:

Component:
<?php

namespace App\Forms\Components;

use Filament\Forms\Components\Field;

class RangeSlider extends Field
{
    protected string $view = 'forms.components.range-slider';

    public string $testVar = 'testValue';
}
<?php

namespace App\Forms\Components;

use Filament\Forms\Components\Field;

class RangeSlider extends Field
{
    protected string $view = 'forms.components.range-slider';

    public string $testVar = 'testValue';
}


View:
<x-dynamic-component
    :component="$getFieldWrapperView()"
    :field="$field"
>
    Value is: {{  $testVar  }}

    <div x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }">
        <!-- Interact with the `state` property in Alpine.js -->
    </div>
</x-dynamic-component>
<x-dynamic-component
    :component="$getFieldWrapperView()"
    :field="$field"
>
    Value is: {{  $testVar  }}

    <div x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }">
        <!-- Interact with the `state` property in Alpine.js -->
    </div>
</x-dynamic-component>


Now where it says 'value is' it correctly echoed the value of my
$testVar
$testVar
, but after updating via Composer it now throws an error
Undefined variable $testVar
Undefined variable $testVar


Is there any way to mitigate this?

Composer:

composer update -W
...
 - Upgrading livewire/livewire (v3.0.0-beta.6 => v3.0.0-beta.7): Extracting archive
  - Upgrading filament/support (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/widgets (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/actions (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/notifications (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/infolists (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/forms (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/tables (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/filament (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading guzzlehttp/psr7 (2.5.0 => 2.6.0): Extracting archive
  - Upgrading guzzlehttp/promises (2.0.0 => 2.0.1): Extracting archive
  - Upgrading phpunit/phpunit (10.2.7 => 10.3.1): Extracting archive
composer update -W
...
 - Upgrading livewire/livewire (v3.0.0-beta.6 => v3.0.0-beta.7): Extracting archive
  - Upgrading filament/support (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/widgets (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/actions (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/notifications (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/infolists (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/forms (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/tables (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading filament/filament (v3.0.6 => v3.0.7): Extracting archive
  - Upgrading guzzlehttp/psr7 (2.5.0 => 2.6.0): Extracting archive
  - Upgrading guzzlehttp/promises (2.0.0 => 2.0.1): Extracting archive
  - Upgrading phpunit/phpunit (10.2.7 => 10.3.1): Extracting archive
Solution
https://github.com/filamentphp/filament/issues/7509#issuecomment-1667797433
GitHub
Custom form field throws ErrorException 'Undefined variable' on cus...
Package filament/forms Package Version v3.0.7 Laravel Version 10.17.1 Livewire Version dev-main 6e529b7 PHP Version PHP 8.2.0 Problem description Created a custom Form Field as described in the doc...
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Undefined variable $component
FilamentFFilament / ❓┊help
2y ago
error Undefined variable $livewire after upgrading filament and livewire
FilamentFFilament / ❓┊help
12mo ago
reload a Livewire form component after updating the record
FilamentFFilament / ❓┊help
2y ago
Livewire Component passing variable to Blade Error
FilamentFFilament / ❓┊help
2y ago