phoenixframework / phoenix_live_reload

Provides live-reload functionality for Phoenix
MIT License
315 stars 90 forks source link

Live reload interfering with Mix's ability to pick up file changes #29

Closed ryanswapp closed 8 years ago

ryanswapp commented 8 years ago

I was working on a project tonight and encountered what appears to be a bug in which the live reload feature is preventing mix from picking up file changes. I'm able to reproduce it by doing the following:

1) Add lib/helpers.ex and define a module with some functions. 2) Use the functions somewhere in the app (I was using them in a controller) 3) Start the phoenix server (everything should be working) 4) While the server is running, rename one of the functions and then update the name wherever you used it in the app. 5) Refresh the browser and you should get an UndefinedFunctionError. 6) Shut down the server and then restart it again 7) If you refresh the page you should still get the UndefinedFunctionError because the helpers.ex file was never recompiled.

In playing around with it, it appears as if the page reload in step 5 is what causes the problem because if you immediately shut down the server and restart it after renaming a file the helpers.ex file will be recompiled.

ryanswapp commented 8 years ago

Actually, In talking with a friend I think I should have submitted this in the main Phoenix repo so I'll move it there.