Skip to content

Mount path is applied twice #5284

@aabrodskiy

Description

@aabrodskiy

First Check

  • I added a very descriptive title here.
  • This is not a Q&A. I am sure something is wrong with NiceGUI or its documentation.
  • I used the GitHub search to find a similar issue and came up empty.

Example Code

fastapi_app = FastAPI()

ui.run_with(
    app=fastapi_app,
    mount_path="/tstudio",
    favicon="⚒",
    reconnect_timeout=10,
)

Description

It was working in 2.17.0 (and starlette 0.45.3, fastapi 0.115.12), but now (with 2.24.2 and starlette 0.48.0, fastapi 0.118.0) I get the errors below.

NiceGUI is applying the mount_path twice in proxying. It could be that the underlying starlette or fastapi changed the way the apply the root path and NiceGUI just applying once again on top.

Nothing changed around it in the k8s configuration, so it must be some recent change in either starlette or nicegui or fastapi. Unfortunately I had to upgrade them all at once, so can't point to either of them now...

>> [WARNING: 2025-10-14 18:36:23,281: nicegui: nicegui.py:156 - _exception_handler_404()]: http://some.domain/tstudio/tstudio/_nicegui/2.24.2/static/nicegui.css not found <<
>> [WARNING: 2025-10-14 18:36:23,283: nicegui: nicegui.py:156 - _exception_handler_404()]: http:/some.domain/tstudio/tstudio/_nicegui/2.24.2/static/socket.io.min.js not found 

NiceGUI Version

2.24.2

Python Version

3.13

Browser

Chrome

Operating System

macOS

Additional Context

No response

Metadata

Metadata

Assignees

Labels

analysisStatus: Requires team/community input

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions