Dashboards & Visualizations

Error in Splunk dashboard while loading

uagraw01
Motivator

Hello Splunkers!!

I am getting below message populating while loading Splunk dashboard as I am using one javascript and css in the dashboard. Please help to fix this error so I will completely disappear.

Error while loading Splunk dashboard.

uagraw01_0-1722698631596.png


Error showing in developer console.

uagraw01_1-1722698654697.png

 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Can you post your javascript?

0 Karma

uagraw01
Motivator
require(["jquery", "splunkjs/mvc", "splunkjs/mvc/simplexml/ready!"], function($, mvc) {
  
    // Properties
    var earliest = 0;
    var latest = 0;
  
    // Update Lead Time to the correct format
    function setFormatLeadTime() {
        $("#lead_time svg text").each(function() {
            if(!$(this).text().match(":")) {
                $(this).text(secondsTimeSpanToDHM($(this).text()));
            }
        });
    }
    
    // Open a URL in a new window
    function setUrl(url) {
        window.open(url, "_blank");
        return false;
    }
  
    // Default Token Components
    var tokens = mvc.Components.get("default");
    
    // Set On-Click listeners
    $("#throughput .splunk-chart").click(function(){ setUrl("/app/customer_reports/throughput_report_-_0136_system?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#availability .splunk-chart").click(function(){ setUrl("/app/customer_reports/availability_report?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#completeness .splunk-chart").click(function(){ setUrl("/app/customer_reports/completeness_order?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#on_time .splunk-chart").click(function(){ setUrl ("/app/customer_reports/on-time_performance_report_customer?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#utilization .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#partitioning .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#group_coherence .splunk-chart").click(function(){ setUrl("/app/customer_reports/load_forming_logic?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#lead_time .splunk-chart").click(function(){ setUrl("/app/customer_reports/lead_time_report?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    $("#productivity .splunk-chart").click(function(){ setUrl("/app/customer_reports/productivity_total?form.time.earliest="+earliest+"&form.time.latest="+latest+"") });
    
    // Set Token listener for Lead Time
    tokens.on("change:lead_time", function(model, value, options) {
        setTimeout(function() { setFormatLeadTime() }, 500);
        setTimeout(function() { setFormatLeadTime() }, 1500);
    });
    
    // Set Token listener for earliest_epoch
    tokens.on("change:time.earliest_epoch", function(model, value, options) {
        earliest = value;
    }); 
    
    // Set Token listener for latest_epoch
    tokens.on("change:time.latest_epoch", function(model, value, options) {
        latest = value;
    }); 

    // Attribute listener for date time picker 
    $("#time div[data-test='time-range-dropdown'] button").attrchange({
        trackValues: true, /* Default to false, if set to true the event object is updated with old and new value.*/
        callback: function (event) { 
            //event               - event object
            //event.attributeName - Name of the attribute modified
            //event.oldValue      - Previous value of the modified attribute
            //event.newValue      - New value of the modified attribute
            //Triggered when the selected elements attribute is added/updated/removed
            if (event.attributeName == "aria-expanded" && event.newValue == "true") {
                $("div[data-test-panel-id='date'] > button[data-test='toggle']").click();
                $("div[data-test='range-type'] button").attrchange({
                    trackValues: true,
                    callback: function (event) { 
                        $("button[data-test-value='since']").click()
                    }
                });
                $("div[data-test-value='between'] > button[data-test='toggle']").click(); 
            }
        }
    });

});

 

@bowesmana Please check the above pasted script.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Have you looked at the chromestatus URL - that tells you the events were deprecated in July 2024 - you can re-enable them, but you may want to look at your script against that explanation.

 

uagraw01
Motivator

@bowesmana Could you help me to understand what does it actually mean ?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Unfortunately not - I don't understand it myself

0 Karma
Get Updates on the Splunk Community!

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...