How to load changes in hooks.py?

I created an custom app today with some JS assets defined in hooks.py:

doctype_js = {
	"Contact" : "public/js/doctypes/contact.js",
	"Lead" : "public/js/doctypes/lead.js",
	"Quotation" : "public/js/doctypes/quotation.js",
	"Opportunity" : "public/js/doctypes/opportunity.js",
	}

This worked fine, until I added more assets in app_include_js. Something broke and now none of my assets are loaded anymore, even with app_include_js commented out. The hooks file looks like before.

The server is in developer mode. The app is installed:

user@server:~/frappe-bench$ bench --site sitename list-apps

frappe  13.19.0 version-13
erpnext 13.19.0 version-13
c_app   0.0.1   master

frappe.get_hooks("doctype_js") shows all assets correctly:

In [1]: frappe.get_hooks("doctype_js")
Out[1]:
{'Web Page': ['public/js/frappe/utils/web_template.js'],
 'Website Settings': ['public/js/frappe/utils/web_template.js'],
 'Address': ['public/js/address.js'],
 'Communication': ['public/js/communication.js'],
 'Event': ['public/js/event.js'],
 'Newsletter': ['public/js/newsletter.js'],
 'Contact': ['public/js/contact.js', 'public/js/doctypes/contact.js'],
 'Lead': ['public/js/doctypes/lead.js'],
 'Quotation': ['public/js/doctypes/quotation.js'],
 'Opportunity': ['public/js/doctypes/opportunity.js']}

I did bench restart and cleared the browser cache multiple times, but when opening one of the DocTypes defined above, the JS file is not loaded (confirmed in Chrome Dev Tools Sources and Console).

When the problems started I did bench migrate. Then I completely uninistalled and reinstalled the Custom App, but it’s still not working. The JS file paths are correct.

Here is a snippet of quotation.js:

frappe.ui.form.on('Quotation', {
    setup(frm) {
        console.log("Loaded JS Asset quotation.js");
    },
});

I am at a loss here, what could I have changed that the files are not loaded anymore? Is there anything I could check? The browser console shows no errors at all.

I rebooted the VM today which caused my assets to load correctly again. But the problem still persists: changes to hooks.py are not picked up. To confirm this I removed a file from doctype_js, but it is still loaded!

Here are all the commands I tried to get the system to reload the hooks file and serve the correct assets:

  • bench clear-cache
  • bench migrate
  • bench build
  • bench restart
  • clear browser cache / delete all cookies and website data

But the new hooks.py is not loaded. frappe.get_hooks("doctype_js") shows the correct assets, but when browsing to Quotation, the JS script is loaded even though I removed the hook.