Title:
Custom App Assets (JS & CSS) Return 404 –
bench build
Breaks All Assets
Post:
Hi everyone,
I’m currently facing a very frustrating issue related to custom app assets not loading.
Problem:
- All JS and CSS files from my custom app are returning 404 Not Found in the browser.
- The file paths are correct, for example:
customapp/public/js/custom_script.js
customapp/public/css/custom_style.css
What I’ve Tried:
- Ran:
bench build --app customapp
→ But the result is still the same: assets not found.
2. Ran:
bench build
→ This made it worse:
- All assets (Frappe, ERPNext) became broken.
- The site is no longer usable due to missing JS/CSS from core apps.
- Checked Redis:
- I verified in
pwd.yml
andcompose_redis.yml
– there is no Redis cache data left, so it shouldn’t be the issue.
Confirmed:
hooks.py
is correctly configured and includes:
app_include_js = "/assets/customapp/js/custom_script.js"
app_include_css = "/assets/customapp/css/custom_style.css"
public/
folder is correctly structured.- After running
bench build
, the assets do appear undersites/assets/customapp
. - I also already have a
build.json
in place.
My Questions:
- Why are the assets still returning 404 even though everything seems correctly built and placed?
- Is there a safe way to rebuild only the custom app’s assets without breaking the core ones?
- Could this be a Docker volume or permission issue?
I’m really stuck and this issue is stressing me out. Any help would be greatly appreciated.
Thanks in advance!