From 93eab3676adcee2369d33dc8db819a8d1d35dd71 Mon Sep 17 00:00:00 2001 From: Viktor Ricchiuto Date: Fri, 22 Dec 2023 16:53:13 +0100 Subject: [PATCH] fix: component path not working in release mode --- msal_streamlit_authentication/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/msal_streamlit_authentication/__init__.py b/msal_streamlit_authentication/__init__.py index a70900e..99cf20f 100644 --- a/msal_streamlit_authentication/__init__.py +++ b/msal_streamlit_authentication/__init__.py @@ -10,7 +10,8 @@ if _USE_WEB_DEV_SERVER: _component_func = components.declare_component(name=COMPONENT_NAME, url=_WEB_DEV_SERVER_URL) else: - build_dir = str(Path(__file__).parent / "frontend" / "dist") + parent_dir = os.path.dirname(os.path.abspath(__file__)) + build_dir = os.path.join(parent_dir, "frontend", "dist") _component_func = components.declare_component(name=COMPONENT_NAME, path=build_dir)