I am getting this same error, but only when adding hooks. I am testing with code straight from docs:
'hooks' => [
'page.create:before' => function ($event) {
var_dump($event->name()); // 'page.create:before'
var_dump($event->type()); // 'page'
var_dump($event->action()); // 'create'
var_dump($event->state()); // 'before'
var_dump($event->page()); // $page
var_dump($event->input()); // $input
}
]
If I keep the hook, but remove var_dump
then the save happens correctly still. Debug mode is enabled. Any ideas?