Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
irinelul opened this issue Aug 30, 2024 · 3 comments
Open
Labels
help wanted Extra attention is needed

Comments

@irinelul
Copy link

irinelul commented Aug 30, 2024

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

@falkoschindler
Copy link
Contributor

Hi @irinelul,

As mentioned in the documentation, most ui.run parameters, like port, need to full restart to become effective.

Nevertheless, the leftover processes are unexpected. Is this also the case without changing the port? Can anyone reproduce this problem?

@falkoschindler falkoschindler added the help wanted Extra attention is needed label Sep 2, 2024
@adarshpunj
Copy link

Can confirm there are no leftover processes after Ctrl+C.

As @falkoschindler mentioned file watcher doesn't register changes in ui.run parameters. However, after restarting, it's running on 1234, and 8000 no longer exists.

Is it more of a OS issue?

OS NiceGUI Python
macOS 13.2 1.4.30 3.10

@rodja
Copy link
Member

rodja commented Sep 12, 2024

Can this be reproduced with a FastPAI / uvicorn scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants