© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
1 reply
Pascal

$rawState Error with RichEditor

Hi, I have a problem with my RichEditor.
I use a relationship in my model form and when I save it without changing the text in the RichEditor than I get this error:

Filament\Forms\Components\RichEditor::Filament\Forms\Components{closure}(): Argument #2 ($rawState) must be of type ?array, string given, called in /vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 36

I found some work arounds but they didn't work.

https://github.com/filamentphp/filament/issues/17472

public function mount($record): void
{
    parent::mount($record);

    /** @var Coach $model */
    $model = $this->record;

    // Convert HTML to Tiptap JSON for RichEditor
    if ($model->listingProfile && is_string($model->listingProfile->about_us) && ! empty($model->listingProfile->about_us)) {
        $editor = new Editor([
            'extensions' => [
                new StarterKit(),
            ],
        ]);

        $editor->setContent($model->listingProfile->about_us);

        // Setze die konvertierten Daten direkt im Form-State
        $this->data['listingProfile']['about_us'] = $editor->getDocument();
        dump($editor);
    }
}
public function mount($record): void
{
    parent::mount($record);

    /** @var Coach $model */
    $model = $this->record;

    // Convert HTML to Tiptap JSON for RichEditor
    if ($model->listingProfile && is_string($model->listingProfile->about_us) && ! empty($model->listingProfile->about_us)) {
        $editor = new Editor([
            'extensions' => [
                new StarterKit(),
            ],
        ]);

        $editor->setContent($model->listingProfile->about_us);

        // Setze die konvertierten Daten direkt im Form-State
        $this->data['listingProfile']['about_us'] = $editor->getDocument();
        dump($editor);
    }
}
GitHub
[v4.x] Error on testing a RichEditor component · Issue #17472 · f...
Package filament/forms Package Version v4.0.3 Laravel Version v12.25.0 Livewire Version v3.6.4 PHP Version 8.4.11 Problem description On testing a RichEditor component I get the following error: Fi...
[v4.x] Error on testing a RichEditor component · Issue #17472 · f...
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

Bug: Multiple RichEditors inside a Repeater cause $rawState type error
FilamentFFilament / ❓┊help
6mo ago
Intermittent RichEditor error inside Repeater: Argument #2 ($rawState) must be of type ?array, strin
FilamentFFilament / ❓┊help
6mo ago
Richeditor undefined error
FilamentFFilament / ❓┊help
14mo ago
Issue with RichEditor
FilamentFFilament / ❓┊help
11mo ago