Expand my Community achievements bar.

VM1531:1 Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)

Avatar

Level 4

Hi friends,

I have problem in my website. Sometimes I see the bug in the console as below.

VM1531:1 Uncaught SyntaxError: Unexpected end of JSON input

    at JSON.parse (<anonymous>)

    at receiveMessage (clientlibs.js:60)

When I click into the clientlibs.js:60 it move to var fromTemplateBrowser = JSON.parse(event.data); as below. This function of the AEM core.

function receiveMessage(event) {

        if (event.origin !== location.origin) {

            return;

        }

        var fromTemplateBrowser = JSON.parse(event.data);

        if (fromTemplateBrowser.sender !== "templatebrowser") {

            return;

        }

        if (fromTemplateBrowser.data) {

            var $sink = $templatePicker.data("sink"), path = fromTemplateBrowser.data.path;

            $sink.val(path).change();

        }

        if (fromTemplateBrowser.config) {

            var action = fromTemplateBrowser.config.action;

            if (action === 'close' || action === 'done') {

                $templatePicker.data("modal").hide();

            }

        }

    }

It was not effect to the function of my site. However, I don't want it happen.

How to fix this bug?

Thanks & Best regards,

BienHV

3 Replies

Avatar

Level 10

Is this a custom component that is causing this?

Avatar

Level 4

That is default in AEM core not a custom component.

Avatar

Level 10

Are you seeing this happen only on specific page? Is there a common component that could be the cause of this?