• Resolved codemonkeynorth

    (@codemonkeynorth)


    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

    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

    (@codemonkeynorth)

    I believe it’s because in WP_DEBUG mode the ajax response is throwing warnings which are breaking the response eg:

    (PHP 8.2)

    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
    
    Plugin Support Shaylee

    (@shayleehansen30)

    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 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.