Dashboards & Visualizations

JavaScript Error on Dashboard Load

jason_hotchkiss
Communicator

Hello -

I have several dashboards that are presenting the user with a pop up box 

Screenshot 2023-12-13 140819.png

 

Reviewing the Browser Console, I see the following:

Screenshot 2023-12-13 140730.png

The culprit seems to be common.js

The dashboard is already using the version=1.1, that I have seen in other posts.  The dashboard doesn't reference any .js scripts nor does it use any lookups to generate results.

<form version="1.1" hideEdit="false">

Any suggestions are appreciated.  Thank you.

However, this issue persists.  

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jason_hotchkiss 

QQ:  Any custom JS you are using across dashboards?  

KV

0 Karma

jason_hotchkiss
Communicator

I know of one file we have (multifix.js)

We use it to modify the behavior of multi-select filters.

/*************************************************************************************
Multiselect Behavior Modification
multifix.js v0.2

Automatically removes 'All' option in multiselect fields when a value is selected and
remove individual values when 'All' is re-selected. 

Any multiselect with an CSS id of multi_1 - multi_15 will function in this way if 
the script is included or the app's dashboard.js or directly.
*************************************************************************************/

require(['splunkjs/mvc', 'splunkjs/mvc/simplexml/ready!'], function (mvc) {
    $(document).ready(function () {
        var selection = [];

        for (var i = 1; i < 16; i++) {
            multiFixer('multi_' + i);
        }

        function multiFixer(fieldId) {
            var multi = splunkjs.mvc.Components.getInstance(fieldId);
            if (typeof multi !== 'undefined' && multi !== 'undefined') {
                multi.on('change', function () {
                    selection = multi.val();
                    if (selection.length > 1 && ~selection.indexOf('*')) {
                        if (selection.indexOf('*') == 0) {
                            selection.splice(selection.indexOf('*'), 1);
                            multi.val(selection);
                            multi.render();
                        } else {
                            multi.val('*');
                            multi.render();
                        }
                    }
                });
            }
        }
    });
});

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Does it happen for all users or just some?

If so, it could be cached JS

0 Karma

jason_hotchkiss
Communicator

It happens for all users.

Tags (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...