This may be a plugin or theme conflict. Please attempt to disable all plugins, and switch to the default Twenty Twenty-One theme. If the problem goes away, enable them one by one to identify the source of the problem.
If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site.
I was referred to this topic from another much more specific topic that’s closed to new replies…
To pkclubpaul I would say he needs to look at any code that’s using an echo statement. Possibly, in a custom shortcode function. I’ve been able to get past this by converting all of them to use print instead (still using an output buffer).
The original topic asks about JSON error when saving if using the block editor and the shortcode function contains the_excerpt(). I could not find a workaround for this one except to call get_content() and then substring the result. That does not produce the JSON error when saving the page that calls the code.
I’ll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.