Single character causing Panel error: "Please fix all form errors" & "The JSON response of the API could not be parsed"


I have recently uploaded a site to a shared hosting environment and am receiving an error when clicking the “OK”/save after submitting text content in a custom block structure field.

The strange thing is, is that it is dependent on the content that is input. There are currently 17189 text characters input in the field. I found that it is a single bracket ( that is causing the error. There are other brackets in the text, however if this particular one is added, the error is thrown.

Please fix all form errors
The JSON response of the API could not be parsed

In dev tools it seems like there is both:
Validate Error
app.js Error

  1. Request URL:

  2. Request Method:

  3. Status Code:

Response Headers

  1. content-length:

  2. content-type:
    text/html; charset=iso-8859-1

  3. date:
    Thu, 28 Jan 2021 00:05:51 GMT

  4. server:

Panel was installed locally.
I have used this hosting provider before, however not with Kirby 3.5.1.

Any ideas would be super helpful.

The field causing the error is a custom block:

            name: Artwork list
                label: Artwork List
                type: structure
                    width: 1/3
                    width: 1/3
                    width: 1/3
                    label: Artwork or gallery title?
                    help: If you need to add a gallery title eg. Gallery 1 choose gallery title.
                    default: artwork
                    type: radio
                      artwork: Artwork
                      gallery: Gallery title
                    type: text
                    label: Gallery Name/Number
                      contentType: gallery
                    placeholder: eg. Gallery 1
                    width: 2/3
                    type: writer
                      contentType: gallery
                    label: Gallery intro text
                    help: Use this field if you need to add a text under the gallery title. Otherwise, leave blank.
                    type: text
                    width: 1/4
                    label: Artwork Number
                      contentType: artwork
                  artworkTitle: -------------------THIS HERE
                    type: writer
                    width: 3/4
                    label: Artwork details
                      contentType: artwork

So you don’t get this error in your local environment? Just guessing maybe an issue with the charset?

Correct, I don’t get it in my local environment. Only on server.

I have below set in snippet:
<meta charset="utf-8">

What I stumbled over was this in the Response header…

Hi @texnixe, it’s my understanding that that charset=iso-8859-1 would be set by kirby because the error is happening in the panel. Would that be right?

I am going to do a fresh starterkit install on this server to see if the problem persists.

Looks like I was able to solve it by deactivating the modsec rule. I will keep an eye on it and mark this solved if the error doesn’t resurface.

No, Kirby’s default charset is utf-8, unless maybe detected otherwise.