diff --git a/next.config.mjs b/next.config.ts similarity index 97% rename from next.config.mjs rename to next.config.ts index 5ccf88163ec9..627392ece685 100644 --- a/next.config.mjs +++ b/next.config.ts @@ -1,6 +1,7 @@ import analyzer from '@next/bundle-analyzer'; import { withSentryConfig } from '@sentry/nextjs'; import withSerwistInit from '@serwist/next'; +import type { NextConfig } from 'next'; const isProd = process.env.NODE_ENV === 'production'; const buildWithDocker = process.env.DOCKER === 'true'; @@ -10,8 +11,7 @@ const API_PROXY_ENDPOINT = process.env.API_PROXY_ENDPOINT || ''; const basePath = process.env.NEXT_PUBLIC_BASE_PATH; -/** @type {import('next').NextConfig} */ -const nextConfig = { +const nextConfig: NextConfig = { basePath, compress: isProd, experimental: { @@ -192,7 +192,7 @@ const nextConfig = { }, }; -const noWrapper = (config) => config; +const noWrapper = (config: NextConfig) => config; const withBundleAnalyzer = process.env.ANALYZE === 'true' ? analyzer() : noWrapper; @@ -207,7 +207,7 @@ const withPWA = isProd const hasSentry = !!process.env.NEXT_PUBLIC_SENTRY_DSN; const withSentry = isProd && hasSentry - ? (c) => + ? (c: NextConfig) => withSentryConfig( c, { @@ -248,4 +248,4 @@ const withSentry = ) : noWrapper; -export default withBundleAnalyzer(withPWA(withSentry(nextConfig))); +export default withBundleAnalyzer(withPWA(withSentry(nextConfig) as NextConfig)); diff --git a/package.json b/package.json index edb98a14336e..10e007fb3023 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "db:push-test": "NODE_ENV=test drizzle-kit push", "db:studio": "drizzle-kit studio", "db:z-pull": "drizzle-kit introspect", - "dev": "next dev -p 3010", + "dev": "next dev --turbo -p 3010", "docs:i18n": "lobe-i18n md && npm run lint:mdx", "docs:seo": "lobe-seo && npm run lint:mdx", "i18n": "npm run workflow:i18n && lobe-i18n", @@ -128,7 +128,7 @@ "@lobehub/tts": "^1.25.1", "@lobehub/ui": "^1.152.0", "@neondatabase/serverless": "^0.10.1", - "@next/third-parties": "^14.2.15", + "@next/third-parties": "^15.0.0", "@react-spring/web": "^9.7.5", "@sentry/nextjs": "^7.119.2", "@serwist/next": "^9.0.9", @@ -174,7 +174,7 @@ "mammoth": "^1.8.0", "modern-screenshot": "^4.4.39", "nanoid": "^5.0.7", - "next": "14.2.8", + "next": "^15.0.0", "next-auth": "beta", "next-mdx-remote": "^4.4.1", "nextjs-toploader": "^3.7.15", @@ -194,9 +194,9 @@ "pwa-install-handler": "^2.6.1", "query-string": "^9.1.1", "random-words": "^2.0.1", - "react": "^18.3.1", + "react": "^19.0.0", "react-confetti": "^6.1.0", - "react-dom": "^18.3.1", + "react-dom": "^19.0.0", "react-fast-marquee": "^1.6.5", "react-hotkeys-hook": "^4.5.1", "react-i18next": "14.0.2", @@ -243,8 +243,8 @@ "@lobehub/i18n-cli": "^1.20.0", "@lobehub/lint": "^1.24.4", "@lobehub/seo-cli": "^1.4.2", - "@next/bundle-analyzer": "^14.2.15", - "@next/eslint-plugin-next": "^14.2.15", + "@next/bundle-analyzer": "^15.0.0", + "@next/eslint-plugin-next": "^15.0.0", "@peculiar/webcrypto": "^1.5.0", "@semantic-release/exec": "^6.0.3", "@testing-library/jest-dom": "^6.6.2", diff --git a/src/app/(main)/repos/[id]/evals/evaluation/page.tsx b/src/app/(main)/repos/[id]/evals/evaluation/page.tsx index 36a157b36fe2..9a661bac7da7 100644 --- a/src/app/(main)/repos/[id]/evals/evaluation/page.tsx +++ b/src/app/(main)/repos/[id]/evals/evaluation/page.tsx @@ -12,7 +12,7 @@ interface Params { id: string; } -type Props = { params: Params }; +type Props = { params: Params & Promise }; const Evaluation = ({ params }: Props) => { const knowledgeBaseId = params.id; diff --git a/src/utils/server/responsive.ts b/src/utils/server/responsive.ts index c2e5ef38ba99..e4b540d05415 100644 --- a/src/utils/server/responsive.ts +++ b/src/utils/server/responsive.ts @@ -1,4 +1,4 @@ -import { headers } from 'next/headers'; +import { type UnsafeUnwrappedHeaders, headers } from 'next/headers'; import { UAParser } from 'ua-parser-js'; /** @@ -9,7 +9,7 @@ export const isMobileDevice = () => { throw new Error('[Server method] you are importing a server-only module outside of server'); } - const { get } = headers(); + const { get } = headers() as unknown as UnsafeUnwrappedHeaders; const ua = get('user-agent'); // console.debug(ua); @@ -26,7 +26,7 @@ export const gerServerDeviceInfo = () => { throw new Error('[Server method] you are importing a server-only module outside of server'); } - const { get } = headers(); + const { get } = headers() as unknown as UnsafeUnwrappedHeaders; const ua = get('user-agent'); // console.debug(ua);