Description
With starlette==1.0.0rc1, importing solara.server.starlette crashes:
TypeError: Starlette.__init__() got an unexpected keyword argument 'on_startup'
Cause: solara/server/starlette.py constructs the app at import time using removed kwargs:
app = Starlette(routes=routes, on_startup=[on_startup], on_shutdown=[on_shutdown], middleware=middleware)
Starlette 1.0 removed on_startup / on_shutdown (replaced by lifespan).
To reproduce
pip install --pre solara starlette
python -c "import solara.server.starlette"
# (also triggers during pytest plugin discovery if solara is installed)
Expected
Solara imports / runs with Starlette 1.0 (or at least doesn’t hard-fail during pytest plugin autoload).
Suggested fix
Use Starlette’s lifespan= instead of on_startup / on_shutdown (or gate by Starlette version).
See Starlette Lifespan docs.