Is the FastApi Integration Broken?

I am using the Panel tutorial on serving directly from Fastapi with the following code. When i access the /panel route in my browser, I get a blank white screen. Can anyone point out what I am doing wrong or if the FastApi Integration is broken? Ultimately, I’d like to use this with Folium, but I cannot get the basic example with a slider to work.

Thank you.

# Third Party
import uvicorn
import panel as pn
from fastapi import FastAPI
from panel.io.fastapi import add_application


pn.extension(sizing_mode="stretch_width")


app = FastAPI()


@app.get("/")
async def read_root():
    return {"Hello": "World"}


@add_application("/panel", app=app, title="My Panel App")
def create_panel_app():
    slider = pn.widgets.IntSlider(name="Slider", start=0, end=10, value=3)
    return slider


if __name__ == "__main__":
    uvicorn.run(app, host="127.0.0.1", port=8080)

Try take a look at GitHub - bokeh/bokeh-fastapi

Hi @Hoxbro, thanks for the response. I did end up getting this and folium working.

There are a few additional required module installs not documented in the Panel site or in the examples which led to the confusion:

I needed to explicitly install the following:

bokeh = "^3.6.1"
bokeh-fastapi = "^0.1.1"
wsproto = "^1.2.0"