Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): resolve React 19 script warning and NavUser useRef crash

Guse3d51324abe3
diff --git a/src/web/next.config.ts b/src/web/next.config.ts
index 68c9e125a..0802b2f38 100644
--- a/src/web/next.config.ts
+++ b/src/web/next.config.ts
@@ -5,7 +5,7 @@ const nextConfig: NextConfig = {
// Prevent the bundler from creating duplicate copies of @better-auth/core,
// which breaks AsyncLocalStorage-based request state (dual module hazard).
// See: https://www.better-auth.com/docs/reference/faq#troubleshooting
- serverExternalPackages: ["better-auth", "@better-auth/core"],
+ serverExternalPackages: ["@better-auth/core"],
turbopack: {
root: path.resolve(__dirname, "../.."),
},
diff --git a/src/web/src/app/layout.tsx b/src/web/src/app/layout.tsx
index 2f5b50ec1..fa27a863b 100644
--- a/src/web/src/app/layout.tsx
+++ b/src/web/src/app/layout.tsx
@@ -8,7 +8,6 @@ import {
} from "next/font/google";
import { GoogleTagManager } from "@next/third-parties/google";
import { ThemeProvider } from "@/components/theme-provider";
-import { ThemeScript } from "@/components/theme-script";
import { ToasterProvider } from "@/components/toaster-provider";
import { TooltipProvider } from "@/components/ui/tooltip";
import "./globals.css";
@@ -117,7 +116,6 @@ export default function RootLayout({
suppressHydrationWarning
>
<head>
- <ThemeScript />
<link rel="manifest" href="/manifest.json" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
diff --git a/src/web/src/components/theme-script.tsx b/src/web/src/components/theme-script.tsx
deleted file mode 100644
index bb02829a0..000000000
--- a/src/web/src/components/theme-script.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-const themeScript = `(function(){try{var s=localStorage.getItem('theme');var d=s==='dark'||((!s||s==='system')&&window.matchMedia('(prefers-color-scheme: dark)').matches);var c=document.documentElement.classList;d?c.add('dark'):c.remove('dark');document.documentElement.style.colorScheme=d?'dark':'light';}catch(e){}})();`;
-
-export function ThemeScript() {
- return (
- <script
- id="theme-script"
- dangerouslySetInnerHTML={{ __html: themeScript }}
- />
- );
-}