Repository navigation
Fix web apps failing to start with FastAPI 0.145+ and prepare 1.0.5 - #6988
Merged
Merged
Conversation
FastAPI 0.145 removed the deprecated `openapi_prefix` argument, which the `flet_web.fastapi.FastAPI` wrapper always forwarded, so `flet run --web`, the web browser view and FastAPI-hosted apps raised a `TypeError` on startup. The wrapper now maps `openapi_prefix` onto `root_path`, as FastAPI itself did before removing it (#6984). Backport of the `flet_fastapi.py` change from 77eace0 on flet-1.1.0. Bump the flet package to 1.0.5.
Deploying flet-website-v2 with
|
| Latest commit: |
32590a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://75976e00.flet-website-v2.pages.dev |
| Branch Preview URL: | https://prepare-release-1-0-5.flet-website-v2.pages.dev |
FeodorFitsner
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6984.
FastAPI 0.145 (fastapi/fastapi#16518) removed the deprecated
openapi_prefixargument.flet_web.fastapi.FastAPIre-declares FastAPI's constructor signature and forwardedopenapi_prefix=""unconditionally, so on any fresh install with 1.0.4flet run --web, the web browser view and FastAPI-hosted apps crash on startup with:Fix
Backport of the
flet_fastapi.pychange from 77eace0 onflet-1.1.0: the wrapper mapsopenapi_prefixontoroot_path(root_path or openapi_prefix), which is exactly what FastAPI ≤0.144 did internally, so existing callers see no behavior change. The Python 3.15 changes from the same commit are left on 1.1.0.test_fastapi.pyfrom that commit is included too: it checks theroot_path/openapi_prefixprecedence and thaton_startup/on_shutdownrun through the custom lifespan. Since CI resolves dependencies fresh, it runs against the latest FastAPI.TypeError)TypeError)Release prep
packages/flet/pubspec.yaml→ 1.0.5, and thefletentry inclient/pubspec.lock(only that line; no other lock changes).## 1.0.5sections inCHANGELOG.mdandpackages/flet/CHANGELOG.md.After merge, tagging
v1.0.5onmainreleases it.Summary by Sourcery
Restore Flet web application startup compatibility with current FastAPI releases and prepare version 1.0.5.
Bug Fixes:
openapi_prefixargument.Enhancements:
root_pathprecedence while maintaining legacyopenapi_prefixbehavior in the Flet FastAPI wrapper.Tests:
Chores: