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

Avatar

Avatar
Validate 10
Level 3
bhoang
Level 3

Likes

11 likes

Total Posts

92 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 3
bhoang
Level 3

Likes

11 likes

Total Posts

92 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
bhoang
Level 3

18-09-2018

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

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

26-09-2018

Is this a custom component that is causing this?

Avatar

Avatar
Validate 10
Level 3
bhoang
Level 3

Likes

11 likes

Total Posts

92 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 3
bhoang
Level 3

Likes

11 likes

Total Posts

92 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
bhoang
Level 3

27-09-2018

That is default in AEM core not a custom component.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

27-09-2018

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