Issue with Adding Custom JavaScript

Hello,

I’m encountering an issue while trying to add custom JavaScript to my Frappe app. I followed the documentation to add the custom JS, and after running bench build, the corresponding dict/js file was created. I also cleared the cache, but the script is not showing up in the frontend. I even checked the assets folder in the browser’s developer tools, but there’s no folder named my_app.

I’ll attach a screenshot for reference.

image

Could someone please provide guidance on how to properly add custom scripts to a Frappe app? Am I missing any steps or configurations?

Thank you!

Please put your script in the public/js/sales_invoice.js and check it.

Please check the documentation.

@NCP
I’ve followed your suggestion and placed the script in public/js/sales_invoice.js, but unfortunately, it’s still not working as expected.

Additionally, I’ve taken the time to explore the ‘India Compliance’ app, and it appears they’re implementing a similar approach to what I’ve attempted. Despite this, I’m still facing issues.

please try with bench build --force

@NCP
running ‘bench build --force’, but unfortunately, the issue persists.

Here’s the log from the ‘bench build’ process for your reference





something is missing but not catching here, check the path, doctype, and file name. because I added with different position/path and it’s worked properly.

@NCP

I’ve carefully reviewed the path, doctype, and file name, and they all seem to be correct. Despite this, the issue persists. I’ve already enabled developer_mode, but I’m wondering if there’s any other configuration setting that could be affecting this. Do you know of any additional settings or configurations that might help resolve this issue?

I think, No