Unexpected token '�', "�ή啉Ȩ顑с̩p�光"… is not valid JSON

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Unexpected token '�', "�ή啉Ȩ顑с̩p�光"… is not valid JSON

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 months, 4 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47612
    douglaskarr
    douglaskarr
    Participant

    It’s not every session, but I’m often getting the following error, which is preventing the live search from executing and even stopping the person from clicking enter or clicking on the search symbol:

    Uncaught SyntaxError: Unexpected token ‘�’, “�ή啉Ȩ顑с̩p�光”… is not valid JSON
    at JSON.parse (<anonymous>)
    at asp-wrapper.js:122:33
    at Array.forEach (<anonymous>)
    at window.ASP.getInstances (asp-wrapper.js:114:34)
    at window.ASP.initializeSearchByID (asp-wrapper.js:89:29)
    at asp-wrapper.js:142:37
    at Array.forEach (<anonymous>)
    at IntersectionObserver.<anonymous> (asp-wrapper.js:140:33)

    #47625
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Douglas,

    I hope you are doing fine!

    After some debugging I have found that one of the search element outputs is altered after it’s printed causing an invalid data object.
    The issue is caused by a backslash character added to the output here: https://i.imgur.com/W3JVtcz.png

    That character is not coming from the plugin, I verified by printing the output, as-is. I suspect perhaps a HTML minification, obfuscation, threat protection via CDN or something along those lines is trying to minify/change the output and somehow that gets there.
    I recommend checking any HTML minify, CDN options or anything along those lines.

    The page looks minified, so it is very likely related to that feature.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #47631
    douglaskarr
    douglaskarr
    Participant

    Thanks Ernest, I’ll dig in deeper to see what i can find!

    #47632
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Let me know 🙂 Maybe I can do something to test and avoid in a future release.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.