Magento – Magento2: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

blockscustomerjsonmagento2

enter image description here

The above code is written in catalog_product_view.xml in module-catalog.
For this block, customer info in the header after login not loading. In console I'm getting this error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.

If I comment on this block it works well. Any solution for this?

Thank You

Best Answer

Sounds like you just have to add

<arguments>
    <argument name="jsLayout" xsi:type="array">
        <item name="components" xsi:type="array">
            <item name="review-form" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Review/js/view/review</item>
            </item>
        </item>
    </argument>
</arguments>

Right after

<container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/>

Don't forget to flush Magento cache with the usual command :

bin/magento c:f;

Source : Reviews in magento 2

Related Topic