Getting Data In

Why can't I add a stylesheet and script to my simple xml dashboard?

matstap
Communicator

I have a simple XML dashboard that is calling two stylesheets and two scripts:

<form stylesheet="styleA.css, styleB.css" script="scriptA.js, scriptB.js">...</form>

styleA.css and scriptA.js are loading properly, but I'm getting these errors for styleB.css and scriptB.js:

Refused to apply style from {styleB.css url} because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

GET {scriptB.js url} 404 (Not Found)

All of these files are located in the appserver/static directory of the app. There are no weird characters that I see in them. I've tried restarting Splunk, as well as splunkweb, doing a _bump after each.

Any tips?

0 Karma
1 Solution

matstap
Communicator

I cleared my browser's cache and it worked lol

View solution in original post

0 Karma

jrouse025
Path Finder

Verify that you are correctly referencing your files. I've seen this problem when not correctly referencing the file location.

My dashboard source had this incorrect reference to a custom style sheet. (receiving MIME incorrect type error)

<dashboard stylesheet="custom_styles.css">

My style sheet actually existed under the directory '/splunk/etc/apps/myapp/appserver/static/styles'

So after updating the dashboard style sheet reference the correct file location all was well.

<dashboard stylesheet="styles/custom_styles.css">

0 Karma

matstap
Communicator

I cleared my browser's cache and it worked lol

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...