Intermittent RichEditor error inside Repeater: Argument #2 ($rawState) must be of type ?array, strin
Hi everyone đź‘‹,
I’m running into an odd issue with RichEditor inside a Repeater (Filament v4). My description column is of type TEXT.
Most of the time things work fine, but I noticed a pattern:
• The first save works without any problem.
• On the second save, if I try to save again without making any changes to the RichEditor, 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
So it seems to only happen on repeated saves where the editor’s content hasn’t changed. It looks like it might be related to how the Repeater re-hydrates the RichEditor state between submissions.
Has anyone else run into this behavior, or is there a known workaround/best practice?
Thanks a lot 🙏
2 Replies
Are you casting to array?
Yes on the model. Even i try change text into json on the data type. It still give me Filament\Forms\Components\RichEditor::Filament\Forms\Components{closure}(): Argument #2 ($rawState) must be of type ?array, string given, called in /Applications/MAMP/htdocs/portofolio-app/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 36 whenever i tried multiple save on the same time.
Any idea Sir? @toeknee