some static files not found when BASE_PATH is changed #5157

Closed
opened 2025-12-29 19:24:53 +01:00 by adam · 3 comments
Owner

Originally created by @nolta on GitHub (Aug 7, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.0-beta1

Python version

3.8

Steps to Reproduce

  1. Set BASE_PATH = 'netbox/'
  2. Run upgrade.sh.
  3. Load site in browser.

Expected Behavior

All static asset files should be found.

Observed Behavior

Some static files cannot be found (i.e., 404 errors).

For example, the site tries to load /static/netbox.js.map instead of /netbox/static/netbox.js.map. The problem appears to be this line: 6845fb0f00/netbox/project-static/dist/netbox.js (L67)

Perhaps due to this?
6845fb0f00/netbox/project-static/bundle.js (L11)

Changing sourceMappingURL=/static/netbox.js.map to sourceMappingURL=netbox.js.map appears to work, at least for this particular file.

Originally created by @nolta on GitHub (Aug 7, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.0-beta1 ### Python version 3.8 ### Steps to Reproduce 1. Set `BASE_PATH = 'netbox/'` 2. Run `upgrade.sh`. 3. Load site in browser. ### Expected Behavior All static asset files should be found. ### Observed Behavior Some static files cannot be found (i.e., 404 errors). For example, the site tries to load `/static/netbox.js.map` instead of `/netbox/static/netbox.js.map`. The problem appears to be this line: https://github.com/netbox-community/netbox/blob/6845fb0f005f0bdc15a258ae2ebd7f9be5341f76/netbox/project-static/dist/netbox.js#L67 Perhaps due to this? https://github.com/netbox-community/netbox/blob/6845fb0f005f0bdc15a258ae2ebd7f9be5341f76/netbox/project-static/bundle.js#L11 Changing `sourceMappingURL=/static/netbox.js.map` to `sourceMappingURL=netbox.js.map` appears to work, at least for this particular file.
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:24:53 +01:00
adam closed this issue 2025-12-29 19:24:53 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 10, 2021):

I don't have any issues loading Javascript resources using the current feature build with a non-default BASE_PATH, however I do see that the Material Design Icons font is being hard-coded to /static/. It also looks like we're pulling the Inter font from fonts.gstatic.com instead of locally.

@jeremystretch commented on GitHub (Aug 10, 2021): I don't have any issues loading Javascript resources using the current `feature` build with a non-default `BASE_PATH`, however I do see that the Material Design Icons font is being hard-coded to `/static/`. It also looks like we're pulling the Inter font from fonts.gstatic.com instead of locally.
Author
Owner

@m2martin commented on GitHub (Aug 12, 2021):

Shouldn't it be avoided to have mixed sources (local statics and external includes)?
In case of the font, this shouldn't cause any problems, as the Open Fonts License for Inter grants copying, embedding and redistributing.
Background: I do have Netbox instances where the clients are not allowed to access external resources.
What's your opinion?

@m2martin commented on GitHub (Aug 12, 2021): Shouldn't it be avoided to have mixed sources (local statics and external includes)? In case of the font, this shouldn't cause any problems, as the [Open Fonts License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL) for `Inter` grants copying, embedding and redistributing. Background: I do have Netbox instances where the clients are not allowed to access external resources. What's your opinion?
Author
Owner

@jeremystretch commented on GitHub (Aug 12, 2021):

Shouldn't it be avoided to have mixed sources (local statics and external includes)?

Yes; NetBox is designed to deliver all static assets locally, to support installations with no Internet access.

@jeremystretch commented on GitHub (Aug 12, 2021): > Shouldn't it be avoided to have mixed sources (local statics and external includes)? Yes; NetBox is designed to deliver all static assets locally, to support installations with no Internet access.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5157