Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

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

0 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?