Try ERPNext Buy Support Partners Foundation

Bench build doesn't run for custom app

Hi,
I downloaded Virtual disk, installed it and use for myself.
For my customization, I created new app mycustomapp.
I want to add new js library
I added hooks.py

app_include_js = ["/assets/mycustomapp/js/mycustomapp.min.js"]

in the folder public I created build.json

{
 	"js/mycustomapp.min.js": [
 		"public/js/test.js",
 	],
 }

then I run bench restart and bench migrate and bench clear-cache and finally bench build
but bench build doesn’t see mycustomapp assets.
in my site_config.json I set "developer_mode": 1
Please help me,
Thank you

1 Like

I still need a help, please

check if you have installed the app on your site or not because build.json and hooks.py seems to be correct.

Thank you for your answer, yes it’s installed
bench list-apps return

frappe
erpnext
mycustomapp

try change it

app_include_js = ["/assets/js/mycustomapp.min.js"]

hi, thank you, unfortunately it doesn’t help(

Did you start again bench?

bench build
bench start

thank you, yes, I’m going to try to run bench reinstall and then update you
@vinhnguyent090 It helped, thank you)

2 Likes

@NMyshuk Natalia, I can’t seem to get it to work on 1 of 2 benches. Did you end up figuring this out?

Edit: it was a syntax error in my build.json

1 Like

hi, this syntax errors are most insidious :slight_smile:

This is actually the second time it’s happened to me. When there’s a syntax error in build.json, the build function doesn’t raise an errors, it just skips it. It’s not that it isn’t my fault, it’s that I wasn’t told it was my fault.

so, maybe you should raise the issue on the github? or if you know how to improve/change build functionality make pull request? (it’s just comment/proposal, just for giving you the answer because the dialog is needed sometimes)

my case is extra comma at end of the last line, sometimes other places this is not a problem at all!
image

I can confirm that the build just ignored the custom app without any error!

1 Like

Same here. The trailing comma is the problem. No error when running bench build.