flet icon indicating copy to clipboard operation
flet copied to clipboard

Hot reload not working on flet version 0.24.1

Open SteveSant26 opened this issue 1 year ago • 3 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

I'm trying to use the hot reload feature by running "flet run main.py -d", but everytime i make a change, my app crashes (?), for example in this code, where i just deleted one letter to the word worlddd, it crashed and didnt make the change. image When I use --web, the hot reload does work as expected, but when i run it as a desktop app, it doesnt.

Code sample

Code
import flet as ft

def main(page: ft.Page):
    page.title = "CRUD SQLITE"
    page.window.min_height = 500
    page.window.min_width = 500
    
    page.theme_mode = "dark"
    
    page.add(ft.Text("Hello Worldd!"))

if __name__ == "__main__":
    ft.app(target=main, view=ft.AppView.FLET_APP)

To reproduce

  1. Run the code
  2. Make a change in the code
  3. See it doesnt changes

Expected behavior

I would expect the hot reload to work properly

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 11 pro 23H2

Flet version

0.24.1

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

SteveSant26 avatar Sep 22 '24 21:09 SteveSant26

Reproducible on macOS sequoia.

ndonkoHenri avatar Oct 08 '24 13:10 ndonkoHenri

Not reproducible on Windows 11.

OwenMcDonnell avatar Oct 08 '24 21:10 OwenMcDonnell

I have the same problem, but i discovered a solution, at least it works for me.

I use alt+tab and i noticed if i did it too fast while the fleet loading ring is still running it will go on an infinity loop, but if you wait a bit until the ring disappears it will work. You can alt+tab but dont release the keypress see the window preview until the loading ring disappears then release the keys.

If you dont want to use alt+tab you can split screen (code editor and running flet app) and work as normal, the key here is not to focus flet window while the loading ring is running

merror-dev avatar Oct 22 '24 00:10 merror-dev

I have the same issue with 0.24.1 on Windows 11 with flet run <app>.

After making a change, about ~10% of the time it freezes with the loading animation and eventually crashes with high RAM usage. At one point it was happening consistently while doing incredibly basic stuff, like running the counter template or displaying a few lines of text...

tobypeschel avatar Nov 01 '24 21:11 tobypeschel

Hey ! It's doing the same for me, it seems to apply the changes after few minutes, but just like tobypeschel with high RAM usage (on desktop app with Windows 11).

SweetKaktus avatar Feb 12 '25 06:02 SweetKaktus

For Windows Users

ft.app(main, view=ft.AppView.WEB_BROWSER

ositoMalvado avatar Mar 02 '25 15:03 ositoMalvado