nicegui: Missing static files and lost connection after upgrade to 1.2.4
Description
I’m trying to run the standard “Hello NiceGui” script on a clean install in a virtrualenv on Python 3.9 and I’m getting several error messages.
from nicegui import ui
ui.label("Hello NiceGUI")
ui.run()
The browser has the message “Connection lost. Trying to reconnect…” and the console displays the following messages:
http://127.0.0.1:8080/_nicegui/1.2.4/static/socket.io.min.js not found http://127.0.0.1:8080/_nicegui/1.2.4/static/nicegui.css not found http://127.0.0.1:8080/_nicegui/1.2.4/static/quasar.prod.css not found http://127.0.0.1:8080/_nicegui/1.2.4/static/fonts.css not found http://127.0.0.1:8080/_nicegui/1.2.4/static/quasar.umd.prod.js not found http://127.0.0.1:8080/_nicegui/1.2.4/static/tailwindcss.min.js not found http://127.0.0.1:8080/_nicegui/1.2.4/static/vue.global.prod.js not found http://127.0.0.1:8080/_nicegui/1.2.4/static/quasar.umd.prod.js not found
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 35 (17 by maintainers)
Commits related to this issue
- #714 disable "follow symlink" on windows (hotfix) — committed to zauberzeug/nicegui by rodja a year ago
- #714 serve static files individually — committed to zauberzeug/nicegui by falkoschindler a year ago
- Merge pull request #720 from zauberzeug/static-files #714 serve static files individually — committed to zauberzeug/nicegui by rodja a year ago
- #714 use Starlette's StaticFiles again — committed to zauberzeug/nicegui by falkoschindler a year ago
- Merge pull request #723 from zauberzeug/static-files #714 use Starlette's StaticFiles again — committed to zauberzeug/nicegui by rodja a year ago
@falkoschindler #720 worked for me on mac with PyInstaller awesome job!
@falkoschindler PR #720 works correctly on Windows with a venv. Thank you for your fast response!
@falkoschindler Sure
@kiwifoxtrot Thanks a lot! This is enough information to finally understand the problem. I opened a discussion over at Starlette: https://github.com/encode/starlette/discussions/2111
Now we only need to decide what that means for our hotfix.
You are correct.
Can you try to locate the
follow_symlinks
parameter in nicegui.py and set it toFalse
? We introduced this one in 1.2.4 to fix NiceGUI in environments like replit.com. But maybe this causes new problems.The code above returns “1.2.4”, tried a second clean virtualenv and installing with no cache. No other apps are running on that PC.