Title: import error &#8211; not valid JSON
Last modified: December 6, 2023

---

# import error – not valid JSON

 *  Resolved [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/)
 * (@codemonkeynorth)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/import-error-not-valid-json/)
 * I have exported a form from one site and tried to import the .nff file into another
   site but I get this Javascript error and nothing happens
 *     ```wp-block-code
       VM1835:1 Uncaught SyntaxError: Unexpected token '<', "<br />
       <fo"... is not valid JSON
       at JSON.parse (anonymous)
       at Object.success (batch-processor.js?ver=6.4.1:76:29)
       at fire (jquery.js?ver=3.7.1:3223:31)
       at Object.fireWith as resolveWith
       at done (jquery.js?ver=3.7.1:9627:14)
       at XMLHttpRequest. (jquery.js?ver=3.7.1:9888:9)
       ```
   

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

 *  Thread Starter [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/)
 * (@codemonkeynorth)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/import-error-not-valid-json/#post-17258271)
 * I believe it’s because in WP_DEBUG mode the ajax response is throwing warnings
   which are breaking the response eg:
   (PHP 8.2)
 *     ```wp-block-code
       Warning: Undefined array key "request_information_1701895166751" 
       in 
       \website\wp-content\plugins\ninja-forms-style\layouts\ninja-forms-layouts.php on line 202
   
       Warning: Trying to access array offset on value 
       of type null in 
       website\wp-content\plugins\ninja-forms-style\layouts\ninja-forms-layouts.php on line 203
       ```
   
    -  This reply was modified 2 years, 5 months ago by [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/).
    -  This reply was modified 2 years, 5 months ago by [codemonkeynorth](https://wordpress.org/support/users/codemonkeynorth/).
 *  [Shaylee](https://wordpress.org/support/users/shayleehansen30/)
 * (@shayleehansen30)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/import-error-not-valid-json/#post-17269201)
 * Hello,
   Thank you for reaching out about this issue. The error you’re encountering
   seems to be related to a JavaScript error and warnings generated by PHP in WP_DEBUG
   mode.
 * First, let’s address the JavaScript error. The “Unexpected token ‘<‘” error suggests
   that the response from the server is not valid JSON. This could be due to a variety
   of reasons, including issues with the export file or conflicts with other plugins
   or themes.
 * To troubleshoot this:
    1. Ensure that your export file (the .nff file) is intact and not corrupted. Try
       exporting the form again from the source site to make sure you have a clean 
       export file.
    2. Deactivate any caching or optimization plugins temporarily, as they might interfere
       with the import process.
    3. Test the import on a fresh WordPress installation with only Ninja Forms and 
       its required dependencies active. This will help isolate any conflicts.
 * Regarding the PHP warnings, while they can indicate issues, they shouldn’t cause
   JSON parsing errors. However, it’s a good practice to address these warnings.
   The warnings you’ve mentioned are generated by the Ninja Forms Layout and Style
   add-on. To resolve them:
    1. Ensure you’re using the latest versions of both Ninja Forms and the Ninja Forms
       Layout and Style add-on, as updates often include bug fixes.
    2. If the warnings persist, you might want to contact Ninja Forms support, as they
       can provide more specific guidance on addressing PHP warnings in their add-ons.
 * If you continue to experience issues after trying these steps, please feel free
   to contact our [Ninja Forms support ](https://ninjaforms.com/contact)for more
   detailed assistance. They can provide tailored support to help you import your
   forms successfully. 🤓

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

The topic ‘import error – not valid JSON’ is closed to new replies.

 * ![](https://ps.w.org/ninja-forms/assets/icon-256x256.png?rev=1649747)
 * [Ninja Forms - The Contact Form Builder That Grows With You](https://wordpress.org/plugins/ninja-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ninja-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ninja-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/ninja-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ninja-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ninja-forms/reviews/)

## Tags

 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * 2 replies
 * 2 participants
 * Last reply from: [Shaylee](https://wordpress.org/support/users/shayleehansen30/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/import-error-not-valid-json/#post-17269201)
 * Status: resolved