Skip to content

Breaking changes in Starlette #847

@sizhky

Description

@sizhky

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: <function _wrap_ex.<locals>._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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions