From d0129b57dd86118990dfa06756724ae1c1afd9ff Mon Sep 17 00:00:00 2001 From: Albert Date: Sun, 9 Nov 2025 15:27:13 +0000 Subject: [PATCH] fix: Resolve TypeScript build errors for production deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add type assertion for SurrealDB query results in debug/nodes route - Install @types/three for Three.js type definitions - Exclude tests directory from TypeScript compilation - Wrap useSearchParams in Suspense boundary on login page (Next.js 16 requirement) All routes now build successfully for production deployment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/api/debug/nodes/route.ts | 2 +- app/login/page.tsx | 18 ++++++++++++++++-- next-env.d.ts | 2 +- package.json | 1 + pnpm-lock.yaml | 3 +++ tsconfig.json | 3 ++- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/api/debug/nodes/route.ts b/app/api/debug/nodes/route.ts index 63ae88f..27ad794 100644 --- a/app/api/debug/nodes/route.ts +++ b/app/api/debug/nodes/route.ts @@ -33,7 +33,7 @@ export async function GET(request: NextRequest) { WHERE user_did = $userDid `; const results = await db.query(nodesQuery, { userDid }); - const nodes = results[0] || []; + const nodes = (results[0] || []) as any[]; // Count stats const stats = { diff --git a/app/login/page.tsx b/app/login/page.tsx index 64513e4..c0da030 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -10,10 +10,10 @@ import { Text, } from '@mantine/core'; import { useForm } from '@mantine/form'; -import { useState } from 'react'; +import { useState, Suspense } from 'react'; import { useSearchParams } from 'next/navigation'; -export default function LoginPage() { +function LoginForm() { const [isLoading, setIsLoading] = useState(false); const searchParams = useSearchParams(); const error = searchParams.get('error'); @@ -89,3 +89,17 @@ export default function LoginPage() { ); } + +export default function LoginPage() { + return ( + + + Loading... + + + }> + + + ); +} diff --git a/next-env.d.ts b/next-env.d.ts index c4b7818..9edff1c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/package.json b/package.json index 6bb5d38..fa24803 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@types/node": "latest", "@types/react": "latest", "@types/react-dom": "latest", + "@types/three": "^0.181.0", "eslint": "latest", "eslint-config-next": "latest", "jiti": "^2.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc06d4c..2ae933d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,6 +99,9 @@ importers: '@types/react-dom': specifier: latest version: 19.2.2(@types/react@19.2.2) + '@types/three': + specifier: ^0.181.0 + version: 0.181.0 eslint: specifier: latest version: 9.39.1(jiti@2.6.1) diff --git a/tsconfig.json b/tsconfig.json index 9e9bbf7..0bfb90b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,6 +36,7 @@ ".next/dev/types/**/*.ts" ], "exclude": [ - "node_modules" + "node_modules", + "tests" ] }