Bench serve with dev mode on does not pick up python code changes

Hi All,

I have frappe started using bench start, and I have developer_mode": 1 set in my site_config.json file.

When I make changes to my controller files, and reload my page in browser, my changes are not shown. The changes only show up after I kill bench with Ctrl-C and re-run bench start.

I have tried doing a hard reload by pressing Ctrl+Shift+R, and when I do this, frappe flashes the helpful yellow Cache Cleared overlay in the bottom right corner of the screen.

Must be something simple that I’m missing. Any tips greatly welcome!

I’m running;

ERPNext Xero Connect: v0.0.1
Frappe Framework: v6.12.2

The file that I’m working on is frappe-bench/apps/erp_xero_connect/erp_xero_connect/erpnext_xero_connect/doctype/xero_settings/xero_settings.py

Thanks,
-Jev

@ebjorsell click the user menu in the upper right of the screen and select the reload option

Same, using the ‘Reload’ from the user menu does not work either.

Normally when i change something in a controller we need to run: bench restart.

@ebjorsell something seems to be off. You don’t need reload for server-side changes.

Maybe you are running separate benches?

Edit: Looking forward to your Xero Connector :smile:

I’m running everything standard using bench start. This isn’t production, my env happens to be running in a virtual box, which I set up using GitHub - frappe/erpnext_vagrant: Vagrantfile and Bootstrap for creating a dev environment for ERPNext

Sure, if I ever get out of the weeds in getting the dev env setup :slight_smile:

It’s a issue with watchdog and Vagrant ou Docker

https://github.com/mitsuhiko/flask/issues/1355
https://github.com/gorakhargosh/watchdog/issues/283

I think this is still a problem in current ERPNext on Vagrant if we use shared_folder, can some one confirm this ? Will it make a difference if we do not use vagrant’s shared folder but editing directly on the VM itself ?

It is not good to have to restart everytime after doing as minor change.

I have same problem, when I use frappe docker and change .py files, changes not affected until i stop bench and start again :frowning:

Is someone fixed this issue for yourself?

Fix the issue Python Changes are not loaded Local Dev Environment Using Vagrant - OSX - #30 by pipech

1 Like