When an exception occurs inside the before_main callback, it is not reported anywhere, and the app will be stuck in the "Working..." state. Example:
import flet as ft
def before_main(page):
1 / 0
def main(page):
page.add(ft.Button("Button"))
ft.run(main=main, before_main=before_main)