• When a single product page which has elements with [data-is_pricing_rules=yes] attributes, a JS error is produced (in Chrome, at least):

    Uncaught RangeError: Maximum call stack size exceeded

    An event is triggered repeatedly until Chrome stops it executing, causing the page’s performance to suffer.

    The event is handled in wcff-client.js line 53:

    $(document).on("change", "[data-is_pricing_rules=yes]", function(e) {
    self.update_negotiate_price( $(this) );
    });
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter treeborn

    (@treeborn)

    …and the event is triggered in a timeout function below that (line 57):

    setTimeout(function(){
    $( '[data-has_field_rules="yes"]' ).trigger( "change" );
    if( wccpf_opt["is_page"] != "archive" ){
    self.update_negotiate_price();
    }
    }, 180 );
    Plugin Contributor sarkparanjothi

    (@sarkparanjothi)

    hi @treeborn,
    If you using pricing rule and field rule same time this error happen i did mistake last version i will fix it on next release.
    For your fix open plugins/wc-fields-factory/wcff-injector.php find

    (this).closest(\".wccpf-fields-container\").find(\"table:not(.wcff_is_hidden_from_field_rule) [data-is_pricing_rules='yes'

    and replace the entire line into

    $field_rules_script .= "/* $(this).closest(\".wccpf-fields-container\").find(\"table:not(.wcff_is_hidden_from_field_rule) [data-is_pricing_rules='yes']\").trigger( \"change\" ); */ }";

    thanks

    Thread Starter treeborn

    (@treeborn)

    Thanks very much @sarkparanjothi.

    I have implemented your fix and the error and performance issues have been resolved.

    Thread Starter treeborn

    (@treeborn)

    Hi @sarkparanjothi,

    I don’t think this fix made it into the plugin – it gets reverted whenever the plugin is updated.

    Could you include it in the future please?

    Thanks very much

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Maximum call stack size exceeded – js frontend event causes performance issue’ is closed to new replies.