Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🧩 fix: Redirect Stability and Build Chunking (#11965)

Danny Avilab01f3ccada12
diff --git a/client/src/hooks/AuthContext.tsx b/client/src/hooks/AuthContext.tsx
index ca69a68f8b..86f80cde6b 100644
--- a/client/src/hooks/AuthContext.tsx
+++ b/client/src/hooks/AuthContext.tsx
@@ -11,8 +11,8 @@ import { debounce } from 'lodash';
import { useRecoilState } from 'recoil';
import { useNavigate } from 'react-router-dom';
import { setTokenHeader, SystemRoles } from 'librechat-data-provider';
-import type { ReactNode } from 'react';
import type * as t from 'librechat-data-provider';
+import type { ReactNode } from 'react';
import {
useGetRole,
useGetUserQuery,
@@ -167,7 +167,8 @@ const AuthContextProvider = ({
navigate(buildLoginRedirectUrl());
},
});
- }, [authConfig?.test, refreshToken, setUserContext, navigate]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- deps are stable at mount; adding refreshToken causes infinite re-fire
+ }, []);
useEffect(() => {
if (userQuery.data) {
diff --git a/client/vite.config.ts b/client/vite.config.ts
index b3f6541ab3..a185215837 100644
--- a/client/vite.config.ts
+++ b/client/vite.config.ts
@@ -8,15 +8,18 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { VitePWA } from 'vite-plugin-pwa';
// https://vitejs.dev/config/
-const backendPort = process.env.BACKEND_PORT && Number(process.env.BACKEND_PORT) || 3080;
-const backendURL = process.env.HOST ? `http://${process.env.HOST}:${backendPort}` : `http://localhost:${backendPort}`;
+const backendPort = (process.env.BACKEND_PORT && Number(process.env.BACKEND_PORT)) || 3080;
+const backendURL = process.env.HOST
+ ? `http://${process.env.HOST}:${backendPort}`
+ : `http://localhost:${backendPort}`;
export default defineConfig(({ command }) => ({
base: '',
server: {
- allowedHosts: process.env.VITE_ALLOWED_HOSTS && process.env.VITE_ALLOWED_HOSTS.split(',') || [],
+ allowedHosts:
+ (process.env.VITE_ALLOWED_HOSTS && process.env.VITE_ALLOWED_HOSTS.split(',')) || [],
host: process.env.HOST || 'localhost',
- port: process.env.PORT && Number(process.env.PORT) || 3090,
+ port: (process.env.PORT && Number(process.env.PORT)) || 3090,
strictPort: false,
proxy: {
'/api': {
@@ -143,7 +146,12 @@ export default defineConfig(({ command }) => ({
if (normalizedId.includes('@dicebear')) {
return 'avatars';
}
- if (normalizedId.includes('react-dnd') || normalizedId.includes('react-flip-toolkit')) {
+ if (
+ normalizedId.includes('react-dnd') ||
+ normalizedId.includes('dnd-core') ||
+ normalizedId.includes('react-flip-toolkit') ||
+ normalizedId.includes('flip-toolkit')
+ ) {
return 'react-interactions';
}
if (normalizedId.includes('react-hook-form')) {
@@ -219,7 +227,10 @@ export default defineConfig(({ command }) => ({
if (normalizedId.includes('framer-motion')) {
return 'framer-motion';
}
- if (normalizedId.includes('node_modules/highlight.js')) {
+ if (
+ normalizedId.includes('node_modules/highlight.js') ||
+ normalizedId.includes('node_modules/lowlight')
+ ) {
return 'markdown_highlight';
}
if (normalizedId.includes('katex') || normalizedId.includes('node_modules/katex')) {