{"record":{"id":"67b98c878a1ca369","repo":"streamlit/streamlit","slug":"streamlitpagenotfounderror","errorCode":null,"errorMessage":"StreamlitPageNotFoundError","messagePattern":"StreamlitPageNotFoundError","errorType":"exception","errorClass":"StreamlitPageNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/streamlit/commands/execution_control.py","lineNumber":325,"sourceCode":"                \"Use st.page_link instead to create a link to external pages.\"\n            )\n        _validate_registered_page(page)\n        page_script_hash = page._script_hash\n    else:\n        # Convert Path to string if necessary\n        if isinstance(page, Path):\n            page = str(page)\n\n        main_script_directory = get_main_script_directory(ctx.main_script_path)\n        requested_page = os.path.realpath(\n            normalize_path_join(main_script_directory, page)\n        )\n        all_app_pages = ctx.pages_manager.get_pages().values()\n\n        matched_pages = [p for p in all_app_pages if p[\"script_path\"] == requested_page]\n\n        if len(matched_pages) == 0:\n            raise StreamlitPageNotFoundError(\n                page=page,\n                main_script_directory=main_script_directory,\n                uses_pages_directory=bool(PagesManager.uses_pages_directory),\n            )\n\n        page_script_hash = matched_pages[0][\"page_script_hash\"]\n\n    # Reset query params (with exception of embed) and optionally apply overrides.\n    with ctx.session_state.query_params() as qp:\n        _set_query_params_for_switch(qp, query_params)\n\n    # Safeguard: sleep longer than the flush interval to ensure at least one\n    # complete flush cycle delivers the query params before the rerun clears\n    # outstanding messages. Sleep is placed after the with block to release\n    # the session state lock first.\n    time.sleep(2 * MESSAGE_FLUSH_INTERVAL_SECS)\n\n    ctx.script_requests.request_rerun(","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/streamlit/streamlit/blob/202661fc552db98c2ba0bb0e113d619689baf9de/lib/streamlit/commands/execution_control.py#L307-L343","documentation":"Error \"StreamlitPageNotFoundError\" thrown in streamlit/streamlit.","triggerScenarios":"Thrown at lib/streamlit/commands/execution_control.py:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"202661fc552db98c2ba0bb0e113d619689baf9de","analyzedAt":"2026-08-26T09:13:21.291Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}