I created a util.js file and added it to hooks.py. It worked the first time, but after I make changes to util.js, the updates are not reflected in the browser.
Currently, I have to rename the JS file and run bench restart to see the changes, but that’s not a good solution.
How can I properly update or reload the JavaScript file after making changes?
I always face this problem, it is mostly properly related to your web browser cache. The only way i know in ‘Google Chrome’ is as follow (or any equivalent method in other web browsers):
- Press 3 Dots on top right of your browser
- Got to Settings
- Click the ‘Privacy and Security’ section on the left sidebar
- Click the ‘Delete Browsing Data’
- Just select ‘Cached Images and Files’
- press ‘Delete Data
- Refresh your ‘ERPNext’ website or use ‘Ctrl +Shift + R’ for Clear Cache Reload
- Changes should reflect now in your website immediately
Go to any web page where that js file is used > Right Click > Inspect > Networking > Check Disable Cache. And keep networking tab open, then a refresh will do the work.
1 Like
Worked perfectly with me. Thanks!