Skip to content

Changing NiceGUI port while running the web server breaks the old port page #3655

@irinelul

Description

@irinelul

Description

While trying out the different content on the niceGUI page, I noticed that the pages broke down, not being able to further modify the content from them. I can't run it on 8080 so I ran it on another port.

from nicegui import ui

with ui.card():
    ui.label('Card content')
    ui.button('Add label', on_click=lambda: ui.label('Click!'))
    ui.timer(1.0, lambda: ui.label('Tick!'), once=True)

ui.run(port=8000)

I used this template.

  1. Create a main.py file with the code above.
  2. Modify the port from 8000 to 1234 and the content to make it distinguishable
  3. The file watcher will find the difference and try to refresh the page
  4. ! Here it will say that it's still listening to the old port!
  5. At this point:
  6. The localhost:8000 is now still available with the old content
  7. The localhost:1234 does not exist
  8. Exit the NiceGUI script with CTRL C
  9. localhost:8000 still persists
  10. localhost:1234 is now available with the changes made.

WindowsTerminal_WJ34n9NNh2

For some reason, the process is alive in chrome and listens to both ports.
OS: W11
Python 3.12
Browser chrome

chrome_yfHC07MnF5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions