• Greetings,

    I am receiving a “Updating failed. Error message: The response is not a valid JSON response.” error when I attempt to put any script / javascript into an Gutenberg HTML block.

    I’ve turned off plugins, updated wordpress version, checked other permissions and can’t seem to isolate the cause. Even doing something as simple as:

    <script>
    console.log('hi):
    </script>
    

    throws the error:

    Full page here:

    https://ibb.co/LnvPz4X

    • This topic was modified 6 years, 2 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 1 replies (of 1 total)
  • Do you have the unfiltered_html capability? You can’t put scripts in the editor if you don’t.
    To get more information, use your browser’s Developer Tools to view the REST response content. That would be on the Net tab of the Tools. Anything (like an error message) that is not in JSON format will cause the error you are seeing.

Viewing 1 replies (of 1 total)

The topic ‘can not post javascript in gutenberg html block’ is closed to new replies.