• Resolved tedpriv

    (@tedpriv)


    I’m running into an “Uncaught TypeError” with this stack trace:

    yasr-front.js?ver=2.5.9:30 Uncaught TypeError: Cannot set property ‘innerHTML’ of null
    at Object.success (yasr-front.js?ver=2.5.9:30)
    at c (jquery.min.js?ver=3.5.1:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?ver=3.5.1:2)
    at l (jquery.min.js?ver=3.5.1:2)
    at XMLHttpRequest.<anonymous> (jquery.min.js?ver=3.5.1:2)

    I’m also seeing a Javascript console error for this query:
    https://<siteurl>/wp-json/wp/v2/posts/747?_fields=yasr_visitor_votes&_wpnonce=0dacf4584e

    Here’s what is odd… I have a fresh WP test site that works fine, and it doesn’t seem to call the JSON API, only admin-ajax. So I don’t understand why my problem site is calling the API.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter tedpriv

    (@tedpriv)

    Also seeing this error on the console:

    yasr-front.js?ver=2.5.9:30 YASR ajax call failed. Showing ratings from html

    Thread Starter tedpriv

    (@tedpriv)

    Ok, more info. This error only happens when Ajax is enabled.

    Thread Starter tedpriv

    (@tedpriv)

    This issue only seems to happen with custom post types.

    Plugin Contributor dudo

    (@dudo)

    Hello!

    Ok, more info. This error only happens when Ajax is enabled.

    this is the point: you can enable or disable this setting for loading result from json api or html instead.
    If ajax is enabled, and for some reason the call fails, then the results are loaded from html.

    Hard to say why in your site the api call fails: most probably a plugin incompatibility: try to disable them 1 by 1 (if you want to load results from json, otherwise simple disable it)

    Best,
    Dario

    WarCry

    (@raulpopi)

    Hello,

    I have the same problem.
    With ajax the specified one appears here.

    If I remove ajax another error appears the following:

    VM6144:1 Uncaught SyntaxError: Unexpected token S in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.success (yasr-front.js?ver=2.5.9:30)
    at c (jquery.min.js?ver=3.5.1:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?ver=3.5.1:2)
    at l (jquery.min.js?ver=3.5.1:2)
    at XMLHttpRequest.<anonymous> (jquery.min.js?ver=3.5.1:2)

    Plugin Contributor dudo

    (@dudo)

    Link to the site?

    Plugin Contributor dudo

    (@dudo)

    Can you also provide a screenshot of your settings?

    Thanks.

    WarCry

    (@raulpopi)

    Hello
    I have found the error, the problem is that in
    [Total:% total_count% Average:% average%]
    I was using just [Average:% average%]

    This is because the tag ‘yasr-vv-votes-number-container -…’ is not created

    So in code:
    document.getElementById(s).innerHTML = e.number of votes
    ‘s’ does not exist because it has not been created.

    In previous versions this did not happen.
    Perhaps you should ask if such a label exists
    % total_count% to handle the error

    thank you for the plugin

    Plugin Contributor dudo

    (@dudo)

    Shame on me, you’re right!!

    I wil fix this ASAP (hope on monday)

    Thank you for sharing this!

    Plugin Contributor dudo

    (@dudo)

    Fixed with version 2.6.1.

    I’ve credited @raulpopi in the changelog.

    Thanks!

    Thread Starter tedpriv

    (@tedpriv)

    Confirmed fixed, thank you!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Uncaught TypeError: Cannot set property ‘innerHTML’ of null’ is closed to new replies.