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 => {