Title: Uncaught SyntaxError: JSON.parse: end of data while reading object
Last modified: August 10, 2020

---

# Uncaught SyntaxError: JSON.parse: end of data while reading object

 *  Resolved [insyde](https://wordpress.org/support/users/insyde/)
 * (@insyde)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-json-parse-end-of-data-while-reading-object/)
 * Hi,
 * after updating ContactForm 7 to Version 5.2.1 and
    Contact Form 7 Conditional
   Fields to Version 1.9.9
 * there is the following error in JS-Console
 * Uncaught SyntaxError: JSON.parse: end of data while reading object contents at
   line 1 column 2 of the JSON data
    Wpcf7cfForm scripts_es6.js:68 js scripts_es6.
   js:1046 jQuery 2 js scripts_es6.js:1045 Webpack 5 scripts_es6.js:68:28 Wpcf7cfForm
   scripts_es6.js:68 js scripts_es6.js:1046 jQuery 2 js scripts_es6.js:1045 Webpack
   5
 * I just fixed all other js errors but have no idea where this comes from.
 * Thx for your help
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-syntaxerror-json-parse-end-of-data-while-reading-object%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-json-parse-end-of-data-while-reading-object/#post-13242152)
 * I can see a problem in the source code of the website.
 * There’s a generated input field that looks like this:
    `<input type="hidden" 
   name="_wpcf7cf_options" value="{"form_id" ...`
 * But it should look like this:
    `<input type="hidden" name="_wpcf7cf_options" 
   value="{&quot;form_id&quot; ...`
 * The quotes should be HTML encoded. Of course this is probably no fault of your
   own, but rather a plugin/theme conflict.
 * Let me give you some more technical details.
 * CF is using the CF7 filer hook `wpcf7_form_hidden_fields`, to create additional
   hidden fields.
 * After this hook is called, and the hidden fields have been set, CF7 will encode
   the values with `esc_attr` [https://developer.wordpress.org/reference/functions/esc_attr/](https://developer.wordpress.org/reference/functions/esc_attr/)
 * For some reason, this is not happening. A possible reason might be that you manually
   copy-pasted the generated code, or that another plugin is modifying the `esc_attr`
   function by hooking into the `attribute_escape` filter. There could be other 
   reasons, but I hope this information gives you an idea where to start looking
   for the cause.
 * If you’re having trouble finding the cause, you could hire me to look into it.
   You can find my details on my website bdwm.be
    -  This reply was modified 5 years, 10 months ago by [Jules Colle](https://wordpress.org/support/users/jules-colle/).
    -  This reply was modified 5 years, 10 months ago by [Jules Colle](https://wordpress.org/support/users/jules-colle/).
    -  This reply was modified 5 years, 10 months ago by [Jules Colle](https://wordpress.org/support/users/jules-colle/).
 *  Thread Starter [insyde](https://wordpress.org/support/users/insyde/)
 * (@insyde)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-json-parse-end-of-data-while-reading-object/#post-13256919)
 * Hi, thx for your reply. But i can´t find the line of code you showed up. should
   it be in the contactforms? or in the plugin code?
    thx
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-json-parse-end-of-data-while-reading-object/#post-13257036)
 * please check here: [https://conditional-fields-cf7.bdwm.be/docs/troubleshooting/does-not-work-with-a-third-party-theme-or-plugin/](https://conditional-fields-cf7.bdwm.be/docs/troubleshooting/does-not-work-with-a-third-party-theme-or-plugin/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught SyntaxError: JSON.parse: end of data while reading object’ is
closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-json-parse-end-of-data-while-reading-object/#post-13257036)
 * Status: resolved