Publishing failed. The response is not a valid JSON response

I bet you are on a localhost server, I had the same issue and fixed changing files permission. ALL wp-content files & folders, and ALL wp-includes folder & files must have full permissions.

If you are on localhost this is not a problem, you could simply give full permission to the entire WP installation