I’m encountering an issue with my Ghost installation where the editor fails to load for certain pages or posts. Instead of displaying the editor, I just see a blank screen. Strangely, this problem doesn’t occur for all pages or posts—some work perfectly fine while others don’t.
The error seems to indicate a JSON parsing issue.
Steps to Reproduce
Login to Ghost admin panel
Open “Pages” or “Posts”
Click on “Edit page/edit post”
Setup information
Ghost Version Version: 5.110.2 Environment: production
Node.js Version
v18.18.0
How did you install Ghost?
Self hosting
Provide details of your host & operating system
OS: Ubuntu 22.04.2 LTS
Hosting: netcup / KVM Server
Specs: 4 Core “QEMU Virtual CPU version 2.5+”, 4.1 GB RAM & 4.1 GB Swap
Database type
MySQL 8
Browser & OS version
Same problem on Windows, Linux, macOS (and in all other browser)
Relevant log / error output Uncaught (in promise) SyntaxError: Expected ',' or '}' after property value in JSON at position 123 (line 1 column 124)
For one of the failing posts, can you use the network tab in your browser’s dev tools to inspect the request to the /ghost/api/admin/posts/{id}/ endpoint? If you look at the preview for that request you should have some content in the lexical property of the first post - please share that if it’s not confidential
Ok, so there’s definitely something weird going on with the header card there. Seems like the contents are being incorrectly escaped somewhere along the line
I’ve not been able to reproduce that so far myself.
How are you creating those header cards? Are you inserting them manually whilst editing or are they copy/pasted?
Also, do you have anything in your network stack that could be modifying the network responses? Maybe some security-related thing on your host or at an edge (e.g. some Cloudflare security stuff)?
Potentially, yes, depending on which firewall features you have enabled. You could always try turning off the orange cloud and running the same test again - creating a header card as you were previously and trying to open the post - to see if there’s any difference.
What’s confusing here is that we’ve not been able to reproduce the issue and haven’t had any other reports which is pointing towards there being something odd with your setup that’s causing the issue. Especially as you appear to get HTML-escaped content in there somehow.
The lexical field is stringified JSON. The content that the editor creates for the header card text typically looks like this when correctly escaped (this is what I’m seeing when testing):
Can you check what the editor is saving for you? With the network inspector open, create a post and add the header card with some text. After that can you find the last PUT request to the /posts/{id}/ endpoint and share what is in the posts[0].lexical field?
That the put request is messed up suggests the Koenig editor or the browser.
What browser and OS are you using? Do you have another browser installed you could try to replicate this with?