Display error message when CSS doesn't load #3452

Closed
opened 2025-12-29 18:29:15 +01:00 by adam · 2 comments
Owner

Originally created by @jeremystretch on GitHub (Mar 9, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.9

Proposed Functionality

Display an error message on the home page when static resources (CSS, JS, etc.) don't load. I haven't worked out yet specifically how we might implement this, just wanted to get the ball rolling.

Use Case

We've seen a number of issues where people have trouble serving static files once NetBox has installed. Although this should work without issue if the installation instructions are followed, there may be exceptions in specific installation environments that are throwing people off. Presenting a user-friendly error message along with some common issues to check would greatly expedite the troubleshooting process.

Database Changes

None

External Dependencies

Probably none.

Originally created by @jeremystretch on GitHub (Mar 9, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.6.9 * NetBox version: 2.7.9 ### Proposed Functionality Display an error message on the home page when static resources (CSS, JS, etc.) don't load. I haven't worked out yet specifically how we might implement this, just wanted to get the ball rolling. ### Use Case We've seen a number of issues where people have trouble serving static files once NetBox has installed. Although this should work without issue if the installation instructions are followed, there may be exceptions in specific installation environments that are throwing people off. Presenting a user-friendly error message along with some common issues to check would greatly expedite the troubleshooting process. ### Database Changes None ### External Dependencies Probably none.
adam added the status: acceptedtype: feature labels 2025-12-29 18:29:15 +01:00
adam closed this issue 2025-12-29 18:29:15 +01:00
Author
Owner

@tb-killa commented on GitHub (Mar 9, 2020):

Maybe something like this?

<script type="text/javascript">
if (typeof jQuery == 'undefined') {
	alert('jQuery is not loaded');
}
</script>

Maybe some sort of redirect to documentation website for fix this issue could be added too.

@tb-killa commented on GitHub (Mar 9, 2020): Maybe something like this? ``` <script type="text/javascript"> if (typeof jQuery == 'undefined') { alert('jQuery is not loaded'); } </script> ``` Maybe some sort of redirect to documentation website for fix this issue could be added too.
Author
Owner

@jeremystretch commented on GitHub (Mar 9, 2020):

I ended up just using onerror on the CSS/JS inclusions to force a redirect to a new view:

netbox_media_failure

@jeremystretch commented on GitHub (Mar 9, 2020): I ended up just using `onerror` on the CSS/JS inclusions to force a redirect to a new view: ![netbox_media_failure](https://user-images.githubusercontent.com/13487278/76250178-2dc8e100-621b-11ea-8970-64e6ccfea040.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3452