Articles on: Magento 2 Pearl Theme User Guide

Potential fix case for Uncaught SyntaxError: Unexpected end of JSON input - Console error displayed on all pages

Sometimes, after editing the content on your CMS Pages or Blocks, you may encounter the following console error on the frontend of your store:


Uncaught SyntaxError: Unexpected end of JSON input


This error may show up on specific pages or across all pages. It can also be accompanied by loss of functionality such as submenus not opening, store switcher dropdowns not working, etc.



Applicability


This issue often applies to stores built with our Pearl Theme for Magento 2, but it can also occur in other setups.



Example of the Error


This is what the error looks like in the browser console:


Console JSON Error



Cause


The error is typically caused by improper HTML code formatting in Newsletter sections of CMS Pages or Blocks.


The issue often originates from the default Magento WYSIWYG Editor, which is known to interfere with and break HTML code.

Learn more about why this editor should be disabled and how to do so in this article.



Example of Improper Formatting


Improper formatting usually appears in Newsletter sections of CMS Pages/Blocks. If the error is present on all pages, the culprit is most likely the Footer.


Example from Footer V3 in the Pearl Theme:


Improper Newsletter Code



Fix


Disabling the WYSIWYG Editor alone will not resolve this issue. You also need to restore the Newsletter code to its original, properly formatted version.


  1. Access the original CMS Page/Block code from the Pearl Theme Demo Admin:

https://pearl.weltpixel.com/admin/demologin


  1. Navigate to:

Admin > Content > Blocks > Footer V3


  1. Locate the original Newsletter section code.


  1. Replace the broken code with the properly formatted version from the demo.


Example of properly formatted code:


Correct Newsletter Code



After Applying the Fix


  • Save the Block.
  • Reload the frontend to check if the error is resolved.
  • If the error persists, flush the Magento Cache from Cache Management.


Once complete, the console error should be gone and all lost functionality restored.

Updated on: 16/09/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!