nicegui icon indicating copy to clipboard operation
nicegui copied to clipboard

When native is True and reload is True, port is ignored and app_shutdown never fires

Open PawelRoman opened this issue 1 year ago • 7 comments

Description

Platform: Linux Mint 20.03 (ubuntu) NiceGUI 1.4.3

Steps to replicate: Save the code below as main.py and run python main.py

from nicegui import app, ui

def app_startup():
    print('app startup')

def app_shutdown():
    print('app shutdown')

app.on_startup(app_startup)
app.on_shutdown(app_shutdown)

ui.run(
    title="Some app",
    port=8502,
    native=True,
    reload=True,
    window_size=(1920, 1200),
    storage_secret='my secret'
)

Expected: Window app opens up, server starts on port 8502, app startup printed out. Actual: Window app opens up, app startup printed out, but server starts on port 8000 (note: I double checked that 8502 is NOT taken by some other process)

Then close the window by clicking "X"

Expected: app shutdown printed out Actual: nothing is printed out, the app_shutdown function is never called

PawelRoman avatar Dec 01 '23 14:12 PawelRoman