I cannot keep a Flet app running in Replit

Every day I have to restart it, I keep seeing at the end of the console message “Could not connected to Flet server in 30 seconds” . I’ve tried “keep alive” and not… Once the error message comes up, I can’t load the page anymore until I restart it.

Hi @ingram861 , welcome to the forums!
Could you send a screenshot or a recordimg of what is happening?

1 Like

I will do, I’ll have to wait for it to happen again, usually within 24 hrs

This looks like the typical error (I was hitting F11 to maximize the browser which added to the message.)

I’m not assigning a port and this is my last line in the flet code
ft.app(main, view=ft.WEB_BROWSER, upload_dir=“waveforms”, assets_dir=“assets”)

When I hit “run” at the top, it starts fine and is good for a while, it always uses a different port

Could you set a port for the program?

I’ve added a port and we’ll see how this goes,

ft.app(main, view=ft.WEB_BROWSER, upload_dir=“waveforms”, assets_dir=“assets”, port=48960)

I’ve set the port and it still gives the “could not connect…” message, I’ve got a better screen capture of the error message

and then after with it running again (note the console message, “no such file…”., I’m not sure is this is proper or my setup.