From ea78f787608805dd68524a9a5844c31aa3927028 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+frooodle@users.noreply.github.com> Date: Wed, 24 Sep 2025 19:55:13 +0100 Subject: [PATCH] empty path fix --- frontend/src/constants/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/constants/app.ts b/frontend/src/constants/app.ts index 4223c76b3..c83cffcfd 100644 --- a/frontend/src/constants/app.ts +++ b/frontend/src/constants/app.ts @@ -7,7 +7,8 @@ export const getBaseUrl = (): string => { }; // Base path from Vite config - build-time constant, normalized (no trailing slash) -export const BASE_PATH = (import.meta.env.BASE_URL || '/').replace(/\/$/, ''); +// When no subpath, use empty string instead of '.' to avoid relative path issues +export const BASE_PATH = (import.meta.env.BASE_URL || '/').replace(/\/$/, '').replace(/^\.$/, ''); /** For in-app navigations when you must touch window.location (rare). */ export const withBasePath = (path: string): string => {