Dash 4.4.1: 当应用入口点以 `Python <subdir>/<script>.py` 形式从父目录运行时, alias_main_module() 会导致双重回调注册
作者: chadothompson-brt创建于 2026年9月25日更新于 2026年9月25日
`dash.dash.alias_main_module()` (added in #3883, to fix `uvicorn.run("app:server", reload=True)` double-import, #3818) causes a **different** double-import when an app's entrypoint file has a directory-name-equals-basename shape (e.g. `app/app.py`) and is launched with `Python app/app.py` from the *parent* directory — the layout used by every "run the script directly" tutorial and by many real apps' `README`s. The self-reimport causes Dash's pages loader to execute every page module a second time, double-registering every page-level `@callback`, which breaks the client with "Duplicate callback outputs" errors.
内容来源: plotly/dash