AnswerDotAI / AnswerDotAI/fasthtml

Breaking changes in Starlette

Open
#847 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
7k
Forks
319
Avg merge
28m
Merged PRs (30d)
3

Description

I faced a few errors with fasthtml today and discovered that starlette has updated to v1, which may have brought some breaking changes.

https://marcelotryle.com/blog/2026/03/22/starlette-10-is-here/

One such error I encountered in starlette's v1.0.0 but not in v0.52.1

```
File "/Users/yeshwanth/.venv/lib/python3.12/site-packages/fasthtml/core.py", line 603, in __init__
super().__init__(debug, routes, middleware=middleware, exception_handlers=excs, on_startup=on_startup, on_shutdown=on_shutdown, lifespan=lifespan)
│ │ │ │ │ │ └ None
│ │ │ │ │ └ None
│ │ │ │ └ None
│ │ │ └ {404: ._f at 0x113c2dda0>}
│ │ └ [Middleware(SessionMiddleware, secret_key='37fdc845-3886-4e8b-a214-c3099a202581', session_cookie='session_', max_age=31536000...
│ └ None
└ False

TypeError: Starlette.__init__() got an unexpected keyword argument 'on_startup'
```

Contributor guide

Open the contributing guide

Research direction

Start at fasthtml/core.py:603, where FastHTML passes on_startup and on_shutdown to Starlette.__init__. Compare the Starlette v0.52.1 and v1.0.0 constructor APIs and reproduce the reported initialization error; done means fasthtml initializes successfully with the newer Starlette version without the unexpected-keyword failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.