Problem with Reactive Searchable Select

Recently I started getting this weird error whenever I try to submit a form using this:
Forms\Components\Select::make('region')
    ->label('Province/State')
    ->disabled(static fn (callable $get) => $get('country') === null)
    ->options(static function (callable $get) {
        $country = $get('country');

        if (! $country) {
           return [];
        }

        return Contact::getRegionOptions($country);
    })
    ->searchable(static fn (Forms\Components\Select $component) => !$component->isDisabled()),

The callback inside the searchable() method is actually necessary in order for the form to be reactive when using disabled() (because searchable selects can't be disabled). Anyways, I recently started to get this weird error.

Upon further investigation, the error does not occur when I remove the callback inside the searchable() method, which basically means I won't be able to have a reactive searchable Select unless I find the fix for this.

This works and no error occurs:
Forms\Components\Select::make('region')
    ->label('Province/State')
    ->disabled(static fn (callable $get) => $get('country') === null)
    ->options(static function (callable $get) {
        $country = $get('country');

        if (! $country) {
           return [];
        }

        return Contact::getRegionOptions($country);
    }),

Please help!
Screenshot_2023-07-02_214828.png
Was this page helpful?