Loading...
Loading...
Debug Streamlit frontend and backend changes using make debug with hot-reload. Use when testing code changes, investigating bugs, checking UI behavior, or needing screenshots of the running app.
npx skill4agent add streamlit/streamlit debugging-streamlitmake debug my_app.pyhttp://localhost:30013000make frontend-dev3002+VITE_PORTfrontend/lib/streamlit/make debugmake debugwork-tmp/debug/work-tmp/debug/latest/latest/*make debugmake debugLog files| File | Content |
|---|---|
| Python |
| Browser |
rg# Search for specific debug messages
rg "DEBUG:" work-tmp/debug/latest/backend.log
# Search for errors (case-insensitive)
rg -i "error|exception|traceback" work-tmp/debug/latest/backend.log
# Search with context (3 lines before/after)
rg -C 3 "my_function" work-tmp/debug/latest/backend.log
# Search frontend logs for specific component
rg "MyComponent" work-tmp/debug/latest/frontend.logprint(f"DEBUG: session_state = {st.session_state}")console.log("DEBUG: props =", props)console.log()work-tmp/debug/latest/frontend.logfrontend.logwork-tmp/debug/work-tmp/debug/test_feature.pymake debug work-tmp/debug/test_feature.pywork-tmp/debug/latest/backend.logErrorExceptionwork-tmp/debug/latest/frontend.loghttp://localhost:30013002+work-tmp/debug/latest/backend.logwork-tmp/debug/latest/backend.logwork-tmp/debug/latest/frontend.log# Backend errors
rg -i "error|exception" work-tmp/debug/latest/backend.log
# Frontend console errors
rg -i "error" work-tmp/debug/latest/frontend.log@playwright/clicd frontend
STREAMLIT_APP_URL=http://localhost:3001
yarn playwright-cli open "$STREAMLIT_APP_URL"
yarn playwright-cli screenshot --filename ../work-tmp/debug/screenshot.png --full-page
yarn playwright-cli closework-tmp/debug/# work-tmp/debug/debug_screenshot.py
"""Temporary Playwright script for debugging - run against make debug."""
import os
from playwright.sync_api import sync_playwright, expect
from e2e_playwright.shared.app_utils import get_text_input, click_button
from e2e_playwright.conftest import wait_for_app_loaded, wait_for_app_run
def main():
app_url = os.environ.get("STREAMLIT_APP_URL", "http://localhost:3001")
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page(viewport={"width": 1280, "height": 720})
# Connect to app started with `make debug`
page.goto(app_url)
wait_for_app_loaded(page)
# Interact with the app
text_input = get_text_input(page, "Name")
text_input.fill("Test User")
click_button(page, "Submit")
wait_for_app_run(page)
# Verify and screenshot
expect(page.get_by_text("Hello, Test User")).to_be_visible()
page.screenshot(path="work-tmp/debug/debug_screenshot.png", full_page=True)
print("Screenshot saved to work-tmp/debug/debug_screenshot.png")
browser.close()
if __name__ == "__main__":
main()make debug <app.py>make debugSTREAMLIT_APP_URLSTREAMLIT_APP_URL=http://localhost:3001 \
PYTHONPATH=. uv run python work-tmp/debug/debug_screenshot.pye2e_playwrighte2e_playwright.shared.app_utilsget_text_input()get_button()click_button()get_checkbox()e2e_playwright.conftestwait_for_app_loaded(page)wait_for_app_run(page)wait_until(page, fn, timeout)# Full page screenshot
page.screenshot(path="work-tmp/debug/full.png", full_page=True)
# Element screenshot
element = page.get_by_test_id("stDataFrame")
element.screenshot(path="work-tmp/debug/dataframe.png")make debug3001-31003000make frontend-devVITE_PORT=3002 make debug <app.py>lib/streamlit/make debugwork-tmp/debug/latest/frontend.logmake debugwait_for_app_loaded(page)page.goto()work-tmp/debug/