page_link and switch_page with /
prefixed path is incorrectly treated as relative path
#8081
Closed
3 of 4 tasks
Labels
feature:st.page_link
feature:st.switch_page
priority:P2
status:confirmed
Bug has been confirmed by the Streamlit team
type:bug
Something isn't working
Checklist
Summary
If I do
st.page_link("/pages/page2.py")
, this is treated as a relative path from the main app file, instead of an absolute path. This is unintuitive, since/
prefixed file paths are usually treated as absolute from the root folder.The same behavior is also true for
st.switch_page()
Reproducible Code Example
Steps To Reproduce
Run the app above, see that it works
Expected Behavior
Throw an error since there's no
/pages/page2.py
from the rootCurrent Behavior
No error, it works (unexpectedly)
Is this a regression?
Debug info
Additional Information
No response
The text was updated successfully, but these errors were encountered: