nextjs - 💡(How to fix) Fix Next16 build `InvariantError` error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85250Fetched 2026-04-08 02:16:44
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×3closed ×1commented ×1issue_type_added ×1

Error Message

11:21:21.361 Running build in Washington, D.C., USA (East) – iad1 11:21:21.362 Build machine configuration: 4 cores, 8 GB 11:21:21.380 Cloning github.com/lobehub/lobe-chat (Branch: next-16, Commit: 8557880) 11:21:21.387 VERCEL_FORCE_NO_BUILD_CACHE is set so skipping build cache step 11:21:23.832 Cloning completed: 2.451s 11:21:24.623 Running "node scripts/vercelIgnoredBuildStep.js" 11:21:24.758 shouldBuild: true 11:21:24.758 11:21:24.759 ✅ - Build can proceed 11:21:24.759 11:21:24.909 Running "vercel build" 11:21:25.344 Vercel CLI 48.2.9 11:21:26.085 Running "install" command: npx [email protected] install... 11:21:27.101 npm warn exec The following package was not found and will be installed: [email protected] 11:21:31.605 bun install v1.2.23 (cf136713) 11:21:31.611 Resolving dependencies 11:22:07.045 Resolved, downloaded and extracted [12946] 11:22:07.046 warn: incorrect peer dependency "[email protected]" 11:22:07.046 11:22:07.046 warn: incorrect peer dependency "[email protected]" 11:22:07.046 11:22:07.046 warn: incorrect peer dependency "[email protected]" 11:22:07.046 11:22:07.046 warn: incorrect peer dependency "[email protected]" 11:22:07.046 11:22:07.047 warn: incorrect peer dependency "[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.047 11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.047 11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.048 11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]" 11:22:07.048 11:22:07.048 warn: incorrect peer dependency "[email protected]" 11:22:07.048 11:22:07.048 warn: incorrect peer dependency "[email protected]" 11:22:07.048 11:22:07.048 warn: incorrect peer dependency "[email protected]" 11:22:07.048 11:22:07.048 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.049 11:22:07.049 warn: incorrect peer dependency "[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "@octokit/[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "[email protected]" 11:22:07.050 11:22:07.050 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.051 warn: incorrect peer dependency "[email protected]" 11:22:07.051 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.052 11:22:07.052 warn: incorrect peer dependency "[email protected]" 11:22:07.053 11:22:07.053 warn: incorrect peer dependency "[email protected]" 11:22:07.053 11:22:07.053 warn: incorrect peer dependency "[email protected]" 11:23:31.212 Saved lockfile 11:23:31.212 11:23:31.212 $ husky 11:23:31.370 11:23:31.370 + @commitlint/[email protected] (v20.1.0 available) 11:23:31.370 + @edge-runtime/[email protected] 11:23:31.370 + @huggingface/[email protected] 11:23:31.374 + @lobechat/types@workspace:packages/types 11:23:31.374 + @lobehub/[email protected] 11:23:31.374 + @lobehub/[email protected] 11:23:31.374 + @lobehub/[email protected] 11:23:31.374 + @lobehub/[email protected] 11:23:31.374 + @next/[email protected] 11:23:31.374 + @next/[email protected] (v16.0.0 available) 11:23:31.374 + @peculiar/[email protected] 11:23:31.374 + @playwright/[email protected] 11:23:31.374 + @prettier/[email protected] 11:23:31.374 + @semantic-release/[email protected] (v7.1.0 available) 11:23:31.374 + @testing-library/[email protected] 11:23:31.374 + @testing-library/[email protected] 11:23:31.374 + @testing-library/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] 11:23:31.374 + @types/[email protected] (v24.9.1 available) 11:23:31.374 + @types/[email protected] 11:23:31.375 + @types/[email protected] 11:23:31.375 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.377 + @types/[email protected] 11:23:31.378 + @types/[email protected] 11:23:31.378 + @types/[email protected] 11:23:31.379 + @typescript/[email protected] 11:23:31.379 + @vitest/[email protected] (v4.0.1 available) 11:23:31.380 + [email protected] 11:23:31.380 + [email protected] (v20.1.0 available) 11:23:31.380 + [email protected] 11:23:31.381 + [email protected] 11:23:31.381 + [email protected] 11:23:31.381 + [email protected] 11:23:31.381 + [email protected] 11:23:31.381 + [email protected] 11:23:31.381 + [email protected] 11:23:31.382 + [email protected] 11:23:31.382 + [email protected] 11:23:31.383 + [email protected] (v9.38.0 available) 11:23:31.383 + [email protected] 11:23:31.384 + [email protected] 11:23:31.384 + [email protected] 11:23:31.385 + [email protected] 11:23:31.386 + [email protected] 11:23:31.386 + [email protected] 11:23:31.386 + [email protected] (v2.0.0 available) 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] (v16.2.6 available) 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] (v8.0.1 available) 11:23:31.389 + [email protected] (v25.0.1 available) 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] (v16.25.0 available) 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] (v5.1.0 available) 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] 11:23:31.389 + [email protected] (v4.0.1 available) 11:23:31.390 + @ant-design/[email protected] (v6.1.0 available) 11:23:31.390 + @ant-design/[email protected] 11:23:31.390 + @anthropic-ai/[email protected] 11:23:31.390 + @auth/[email protected] (v0.41.0 available) 11:23:31.390 + @aws-sdk/[email protected] (v3.914.0 available) 11:23:31.391 + @aws-sdk/[email protected] (v3.914.0 available) 11:23:31.391 + @azure-rest/[email protected] 11:23:31.391 + @azure/[email protected] 11:23:31.391 + @cfworker/[email protected] 11:23:31.392 + @clerk/[email protected] 11:23:31.392 + @clerk/[email protected] 11:23:31.392 + @clerk/[email protected] 11:23:31.392 + @codesandbox/[email protected] 11:23:31.392 + @cyntler/[email protected] 11:23:31.392 + @electric-sql/[email protected] (v0.3.11 available) 11:23:31.392 + @emotion/[email protected] 11:23:31.392 + @fal-ai/[email protected] 11:23:31.392 + @formkit/[email protected] 11:23:31.392 + @google/[email protected] 11:23:31.392 + @huggingface/[email protected] 11:23:31.393 + @icons-pack/[email protected] 11:23:31.393 + @khmyznikov/[email protected] (v0.5.8 available) 11:23:31.393 + @langchain/[email protected] (v1.0.0 available) 11:23:31.393 + @lobechat/agent-runtime@workspace:packages/agent-runtime 11:23:31.393 + @lobechat/const@workspace:packages/const 11:23:31.393 + @lobechat/context-engine@workspace:packages/context-engine 11:23:31.394 + @lobechat/database@workspace:packages/database 11:23:31.394 + @lobechat/electron-client-ipc@workspace:packages/electron-client-ipc 11:23:31.394 + @lobechat/electron-server-ipc@workspace:packages/electron-server-ipc 11:23:31.394 + @lobechat/file-loaders@workspace:packages/file-loaders 11:23:31.394 + @lobechat/model-runtime@workspace:packages/model-runtime 11:23:31.394 + @lobechat/observability-otel@workspace:packages/obervability-otel 11:23:31.394 + @lobechat/prompts@workspace:packages/prompts 11:23:31.394 + @lobechat/python-interpreter@workspace:packages/python-interpreter 11:23:31.394 + @lobechat/utils@workspace:packages/utils 11:23:31.394 + @lobechat/web-crawler@workspace:packages/web-crawler 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.394 + @lobehub/[email protected] 11:23:31.397 + @modelcontextprotocol/[email protected] 11:23:31.397 + @neondatabase/[email protected] 11:23:31.398 + @next/[email protected] 11:23:31.398 + @opentelemetry/[email protected] 11:23:31.398 + @opentelemetry/[email protected] (v0.18.0 available) 11:23:31.398 + @react-pdf/[email protected] 11:23:31.398 + @react-spring/[email protected] (v10.0.3 available) 11:23:31.398 + @saintno/[email protected] 11:23:31.398 + @serwist/[email protected] 11:23:31.398 + @t3-oss/[email protected] 11:23:31.398 + @tanstack/[email protected] 11:23:31.398 + @trpc/[email protected] 11:23:31.398 + @trpc/[email protected] 11:23:31.399 + @trpc/[email protected] 11:23:31.399 + @trpc/[email protected] 11:23:31.399 + @vercel/[email protected] 11:23:31.399 + @vercel/[email protected] 11:23:31.400 + @vercel/[email protected] 11:23:31.400 + @vercel/[email protected] 11:23:31.400 + @virtuoso.dev/[email protected] 11:23:31.400 + @xterm/[email protected] 11:23:31.401 + [email protected] 11:23:31.401 + [email protected] 11:23:31.401 + [email protected] 11:23:31.401 + [email protected] 11:23:31.402 + [email protected] 11:23:31.402 + [email protected] 11:23:31.402 + [email protected] 11:23:31.402 + [email protected] 11:23:31.402 + [email protected] 11:23:31.402 + [email protected] (v4.2.1 available) 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] (v0.8.3 available) 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] 11:23:31.403 + [email protected] 11:23:31.404 + [email protected] 11:23:31.404 + [email protected] 11:23:31.404 + [email protected] 11:23:31.404 + [email protected] 11:23:31.404 + [email protected] 11:23:31.404 + [email protected] 11:23:31.405 + [email protected] 11:23:31.405 + [email protected] (v6.1.0 available) 11:23:31.405 + [email protected] 11:23:31.405 + [email protected] 11:23:31.405 + [email protected] (v5.5.3 available) 11:23:31.405 + [email protected] (v1.0.1 available) 11:23:31.405 + [email protected] 11:23:31.406 + [email protected] 11:23:31.406 + [email protected] 11:23:31.406 + [email protected] (v0.546.0 available) 11:23:31.406 + [email protected] 11:23:31.407 + [email protected] 11:23:31.407 + [email protected] 11:23:31.407 + [email protected] 11:23:31.407 + model-bank@workspace:packages/model-bank 11:23:31.407 + [email protected] 11:23:31.407 + [email protected] 11:23:31.407 + [email protected] 11:23:31.407 + [email protected] 11:23:31.408 + [email protected] 11:23:31.408 + [email protected] 11:23:31.408 + [email protected] 11:23:31.408 + [email protected] 11:23:31.409 + [email protected] 11:23:31.409 + [email protected] (v5.2.1 available) 11:23:31.409 + [email protected] 11:23:31.409 + [email protected] 11:23:31.410 + [email protected] (v6.6.0 available) 11:23:31.410 + [email protected] (v0.15.0 available) 11:23:31.410 + [email protected] 11:23:31.410 + [email protected] 11:23:31.411 + [email protected] (v2.4.5 available) 11:23:31.411 + [email protected] (v5.4.296 available) 11:23:31.411 + [email protected] 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] (v10.1.0 available) 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] (v1.279.3 available) 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] 11:23:31.412 + [email protected] 11:23:31.413 + [email protected] 11:23:31.413 + [email protected] 11:23:31.413 + [email protected] 11:23:31.413 + [email protected] 11:23:31.414 + [email protected] (v16.1.5 available) 11:23:31.414 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] (v10.2.0 available) 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.415 + [email protected] 11:23:31.416 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + [email protected] 11:23:31.417 + ssrf-safe-fetch@workspace:packages/ssrf-safe-fetch 11:23:31.417 + [email protected] (v19.1.0 available) 11:23:31.417 + [email protected] 11:23:31.418 + [email protected] 11:23:31.418 + [email protected] 11:23:31.418 + [email protected] 11:23:31.418 + [email protected] 11:23:31.418 + [email protected] 11:23:31.419 + [email protected] (v2.0.6 available) 11:23:31.420 + [email protected] (v0.28.0 available) 11:23:31.421 + [email protected] 11:23:31.421 + [email protected] 11:23:31.421 + [email protected] (v13.0.0 available) 11:23:31.421 + [email protected] 11:23:31.421 + [email protected] 11:23:31.421 + [email protected] 11:23:31.421 + [email protected] (v4.1.12 available) 11:23:31.421 + [email protected] (v5.0.8 available) 11:23:31.421 + [email protected] 11:23:31.421 11:23:31.421 3390 packages installed [119.77s] 11:23:31.421 11:23:31.421 Blocked 10 postinstalls. Run bun pm untrusted for details. 11:23:31.581 Detected Next.js version: 16.0.0 11:23:31.582 Running "bun run build" 11:23:31.940 $ tsx scripts/prebuild.mts && bun run lint 11:23:32.965 [[email protected]] injecting env (0) from .env -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit 11:23:32.966 Starting prebuild cleanup... 11:23:32.968 ♻️ Removed src/app/desktop successfully 11:23:32.969 ♻️ Removed src/app/(backend)/trpc/desktop successfully 11:23:32.969 Prebuild cleanup completed. 11:23:32.998 $ bun run lint:ts && bun run lint:style && bun run type-check && bun run lint:circular 11:23:33.002 $ eslint "{src,tests}//*.{js,jsx,ts,tsx}" --fix 11:24:18.865 $ stylelint "{src,tests}//.{js,jsx,ts,tsx}" --fix 11:24:53.965 11:24:53.965 Deprecation warnings: 11:24:53.965 - The "function-whitespace-after" rule is deprecated. 11:24:53.965 - The "media-feature-range-operator-space-after" rule is deprecated. 11:24:53.965 - The "media-feature-range-operator-space-before" rule is deprecated. 11:24:53.965 11:24:54.019 $ tsgo --noEmit 11:25:19.162 $ bun run lint:circular:main && bun run lint:circular:packages 11:25:19.166 $ dpdm src/**/.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular 11:25:19.292

⠋ Start analyzing dependencies...

Start analyzing dependencies... 11:25:19.593 • Circular Dependencies 11:25:19.593 🚀 No circular dependencies found. 11:25:19.593 Analyze done! 11:25:19.600 $ dpdm packages//src//*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular 11:25:19.723

⠋ Start analyzing dependencies...

Start analyzing dependencies... 11:25:20.185 • Circular Dependencies 11:25:20.186 🚀 No circular dependencies found. 11:25:20.186 Analyze done! 11:25:20.192 $ cross-env NODE_OPTIONS=--max-old-space-size=6144 next build 11:25:21.696 [@serwist/next] WARNING: You are using '@serwist/next' with next dev --turbopack, but Serwist doesn't support Turbopack at the moment. It is recommended that you set disable to process.env.NODE_ENV !== "production". Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1. 11:25:21.724 Attention: Next.js now collects completely anonymous telemetry regarding usage. 11:25:21.725 This information is used to shape Next.js' roadmap and prioritize features. 11:25:21.725 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: 11:25:21.725 https://nextjs.org/telemetry 11:25:21.725 11:25:21.747 ▲ Next.js 16.0.0 (Turbopack) 11:25:21.748 - Experiments (use with caution): 11:25:21.748 · optimizePackageImports 11:25:21.748 ⨯ serverMinification 11:25:21.748 ✓ turbopackFileSystemCacheForDev 11:25:21.748 ✓ webpackBuildWorker 11:25:21.748 ✓ webpackMemoryOptimizations 11:25:21.748 · webVitalsAttribution 11:25:21.748 11:25:21.848 Creating an optimized production build ... 11:25:22.780 [@serwist/next] WARNING: You are using '@serwist/next' with next dev --turbopack, but Serwist doesn't support Turbopack at the moment. It is recommended that you set disable to process.env.NODE_ENV !== "production". Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1. 11:28:20.272 Turbopack build encountered 2 warnings: 11:28:20.272 ./node_modules/@opentelemetry/instrumentation/build/esm/platform/node 11:28:20.272 Package require-in-the-middle can't be external 11:28:20.272 The request require-in-the-middle matches serverExternalPackages (or the default list). 11:28:20.272 The package resolves to a different version when requested from the project directory (7.5.2) compared to the package requested from the importing module (8.0.1). 11:28:20.272 Make sure to install the same version of the package in both locations. 11:28:20.272 11:28:20.272 11:28:20.272 [externals]/node:buffer 11:28:20.272 unexpected export * 11:28:20.278 export * used with module [externals]/node:buffer [external] (node:buffer, cjs) which is a CommonJS module with exports only available at runtime 11:28:20.278 List all export names manually (export { a, b, c } from "...") or rewrite the module to ESM, to avoid the additional runtime code. 11:28:20.279 11:28:20.279 Import trace: 11:28:20.279 external: 11:28:20.279 [externals]/node:buffer [external] 11:28:20.279 ./node_modules/jose/dist/node/esm/runtime/base64url.js [App Route] 11:28:20.279 ./node_modules/jose/dist/node/esm/key/import.js [App Route] 11:28:20.279 ./src/libs/oidc-provider/jwt.ts [App Route] 11:28:20.279 ./src/app/(backend)/middleware/auth/index.ts [App Route] 11:28:20.279 ./src/app/(backend)/webapi/text-to-image/[provider]/route.ts [App Route] 11:28:20.279 11:28:20.279 11:28:21.267 ✓ Compiled successfully in 3.0min 11:28:21.267 Skipping validation of types 11:28:25.839 Collecting page data ... 11:28:31.450 ⚠ Using edge runtime on a page currently disables static generation for that page 11:28:34.056 Error [InvariantError]: Invariant: Unexpected match for a pathname "/en-US__1__dark/files/(.)[id]" with a param "id" of type "dynamic-intercepted". This is a bug in Next.js. 11:28:34.057 at ignore-listed frames 11:28:34.064 11:28:34.065 > Build error occurred 11:28:34.068 Error: Failed to collect page data for /[variants]/files/(.)[id] 11:28:34.069 at ignore-listed frames { 11:28:34.069 type: 'Error' 11:28:34.069 } 11:28:34.158 error: script "build" exited with code 1 11:28:34.199 Error: Command "bun run build" exited with 1

Code Example

11:21:21.361 Running build in Washington, D.C., USA (East) – iad1
11:21:21.362 Build machine configuration: 4 cores, 8 GB
11:21:21.380 Cloning github.com/lobehub/lobe-chat (Branch: next-16, Commit: 8557880)
11:21:21.387 VERCEL_FORCE_NO_BUILD_CACHE is set so skipping build cache step
11:21:23.832 Cloning completed: 2.451s
11:21:24.623 Running "node scripts/vercelIgnoredBuildStep.js"
11:21:24.758 shouldBuild: true
11:21:24.758 
11:21:24.759- Build can proceed
11:21:24.759 
11:21:24.909 Running "vercel build"
11:21:25.344 Vercel CLI 48.2.9
11:21:26.085 Running "install" command: `npx [email protected] install`...
11:21:27.101 npm warn exec The following package was not found and will be installed: bun@1.2.23
11:21:31.605 bun install v1.2.23 (cf136713)
11:21:31.611 Resolving dependencies
11:22:07.045 Resolved, downloaded and extracted [12946]
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "@octokit/[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.053 
11:22:07.053 warn: incorrect peer dependency "[email protected]"
11:22:07.053 
11:22:07.053 warn: incorrect peer dependency "[email protected]"
11:23:31.212 Saved lockfile
11:23:31.212 
11:23:31.212 $ husky
11:23:31.370 
11:23:31.370 + @commitlint/cli@19.8.1 (v20.1.0 available)
11:23:31.370 + @edge-runtime/vm@5.0.0
11:23:31.370 + @huggingface/tasks@0.19.58
11:23:31.374 + @lobechat/types@workspace:packages/types
11:23:31.374 + @lobehub/i18n-cli@1.25.1
11:23:31.374 + @lobehub/lint@1.26.2
11:23:31.374 + @lobehub/market-types@1.11.4
11:23:31.374 + @lobehub/seo-cli@1.7.0
11:23:31.374 + @next/bundle-analyzer@16.0.0-beta.0
11:23:31.374 + @next/eslint-plugin-next@15.5.6 (v16.0.0 available)
11:23:31.374 + @peculiar/webcrypto@1.5.0
11:23:31.374 + @playwright/test@1.56.1
11:23:31.374 + @prettier/sync@0.6.1
11:23:31.374 + @semantic-release/exec@6.0.3 (v7.1.0 available)
11:23:31.374 + @testing-library/jest-dom@6.9.1
11:23:31.374 + @testing-library/react@16.3.0
11:23:31.374 + @testing-library/user-event@14.6.1
11:23:31.374 + @types/chroma-js@3.1.1
11:23:31.374 + @types/crypto-js@4.2.2
11:23:31.374 + @types/debug@4.1.12
11:23:31.374 + @types/fs-extra@11.0.4
11:23:31.374 + @types/ip@1.1.3
11:23:31.374 + @types/json-schema@7.0.15
11:23:31.374 + @types/lodash@4.17.20
11:23:31.374 + @types/lodash-es@4.17.12
11:23:31.374 + @types/node@22.18.12 (v24.9.1 available)
11:23:31.374 + @types/numeral@2.0.5
11:23:31.375 + @types/oidc-provider@9.5.0
11:23:31.375 + @types/pdfkit@0.17.3
11:23:31.377 + @types/pg@8.15.5
11:23:31.377 + @types/react@19.2.2
11:23:31.377 + @types/react-dom@19.2.2
11:23:31.377 + @types/rtl-detect@1.0.3
11:23:31.377 + @types/semver@7.7.1
11:23:31.377 + @types/systemjs@6.15.3
11:23:31.377 + @types/ua-parser-js@0.7.39
11:23:31.378 + @types/unist@3.0.3
11:23:31.378 + @types/ws@8.18.1
11:23:31.379 + @typescript/native-preview@7.0.0-dev.20250711.1
11:23:31.379 + @vitest/coverage-v8@3.2.4 (v4.0.1 available)
11:23:31.380 + ajv-keywords@5.1.0
11:23:31.380 + commitlint@19.8.1 (v20.1.0 available)
11:23:31.380 + consola@3.4.2
11:23:31.381 + cross-env@10.1.0
11:23:31.381 + crypto-js@4.2.0
11:23:31.381 + dbdocs@0.16.2
11:23:31.381 + dotenv@17.2.3
11:23:31.381 + dotenv-expand@12.0.3
11:23:31.381 + dpdm-fast@1.0.14
11:23:31.382 + drizzle-dbml-generator@0.10.0
11:23:31.382 + drizzle-kit@0.31.5
11:23:31.383 + eslint@8.57.1 (v9.38.0 available)
11:23:31.383 + eslint-plugin-mdx@3.6.2
11:23:31.384 + fake-indexeddb@6.2.4
11:23:31.384 + fs-extra@11.3.2
11:23:31.385 + glob@11.0.3
11:23:31.386 + happy-dom@20.0.8
11:23:31.386 + husky@9.1.7
11:23:31.386 + import-in-the-middle@1.15.0 (v2.0.0 available)
11:23:31.389 + just-diff@6.0.2
11:23:31.389 + lint-staged@15.5.2 (v16.2.6 available)
11:23:31.389 + lodash@4.17.21
11:23:31.389 + markdown-table@3.0.4
11:23:31.389 + mcp-hello-world@1.1.2
11:23:31.389 + mime@4.1.0
11:23:31.389 + node-fetch@3.3.2
11:23:31.389 + node-gyp@11.5.0
11:23:31.389 + openapi-typescript@7.10.1
11:23:31.389 + p-map@7.0.3
11:23:31.389 + prettier@3.6.2
11:23:31.389 + remark-cli@12.0.1
11:23:31.389 + remark-frontmatter@5.0.0
11:23:31.389 + remark-mdx@3.1.1
11:23:31.389 + remark-parse@11.0.0
11:23:31.389 + require-in-the-middle@7.5.2 (v8.0.1 available)
11:23:31.389 + semantic-release@21.1.2 (v25.0.1 available)
11:23:31.389 + serwist@9.2.1
11:23:31.389 + stylelint@15.11.0 (v16.25.0 available)
11:23:31.389 + tsx@4.20.6
11:23:31.389 + type-fest@4.41.0 (v5.1.0 available)
11:23:31.389 + typescript@5.9.3
11:23:31.389 + unified@11.0.5
11:23:31.389 + unist-util-visit@5.0.0
11:23:31.389 + vite@7.1.11
11:23:31.389 + vitest@3.2.4 (v4.0.1 available)
11:23:31.390 + @ant-design/icons@5.6.1 (v6.1.0 available)
11:23:31.390 + @ant-design/pro-components@2.8.10
11:23:31.390 + @anthropic-ai/sdk@0.67.0
11:23:31.390 + @auth/core@0.40.0 (v0.41.0 available)
11:23:31.390 + @aws-sdk/client-s3@3.893.0 (v3.914.0 available)
11:23:31.391 + @aws-sdk/s3-request-presigner@3.893.0 (v3.914.0 available)
11:23:31.391 + @azure-rest/ai-inference@1.0.0-beta.5
11:23:31.391 + @azure/core-auth@1.10.1
11:23:31.391 + @cfworker/json-schema@4.1.1
11:23:31.392 + @clerk/localizations@3.26.3
11:23:31.392 + @clerk/nextjs@6.34.0
11:23:31.392 + @clerk/themes@2.4.29
11:23:31.392 + @codesandbox/sandpack-react@2.20.0
11:23:31.392 + @cyntler/react-doc-viewer@1.17.1
11:23:31.392 + @electric-sql/pglite@0.2.17 (v0.3.11 available)
11:23:31.392 + @emotion/react@11.14.0
11:23:31.392 + @fal-ai/client@1.7.0
11:23:31.392 + @formkit/auto-animate@0.9.0
11:23:31.392 + @google/genai@1.26.0
11:23:31.392 + @huggingface/inference@4.12.0
11:23:31.393 + @icons-pack/react-simple-icons@13.8.0
11:23:31.393 + @khmyznikov/pwa-install@0.3.9 (v0.5.8 available)
11:23:31.393 + @langchain/community@0.3.57 (v1.0.0 available)
11:23:31.393 + @lobechat/agent-runtime@workspace:packages/agent-runtime
11:23:31.393 + @lobechat/const@workspace:packages/const
11:23:31.393 + @lobechat/context-engine@workspace:packages/context-engine
11:23:31.394 + @lobechat/database@workspace:packages/database
11:23:31.394 + @lobechat/electron-client-ipc@workspace:packages/electron-client-ipc
11:23:31.394 + @lobechat/electron-server-ipc@workspace:packages/electron-server-ipc
11:23:31.394 + @lobechat/file-loaders@workspace:packages/file-loaders
11:23:31.394 + @lobechat/model-runtime@workspace:packages/model-runtime
11:23:31.394 + @lobechat/observability-otel@workspace:packages/obervability-otel
11:23:31.394 + @lobechat/prompts@workspace:packages/prompts
11:23:31.394 + @lobechat/python-interpreter@workspace:packages/python-interpreter
11:23:31.394 + @lobechat/utils@workspace:packages/utils
11:23:31.394 + @lobechat/web-crawler@workspace:packages/web-crawler
11:23:31.394 + @lobehub/analytics@1.6.0
11:23:31.394 + @lobehub/charts@2.1.2
11:23:31.394 + @lobehub/chat-plugin-sdk@1.32.4
11:23:31.394 + @lobehub/chat-plugins-gateway@1.9.0
11:23:31.394 + @lobehub/editor@1.21.0
11:23:31.394 + @lobehub/icons@2.43.1
11:23:31.394 + @lobehub/market-sdk@0.22.7
11:23:31.394 + @lobehub/tts@2.0.1
11:23:31.394 + @lobehub/ui@2.13.4
11:23:31.397 + @modelcontextprotocol/sdk@1.20.1
11:23:31.397 + @neondatabase/serverless@1.0.2
11:23:31.398 + @next/third-parties@16.0.0-beta.0
11:23:31.398 + @opentelemetry/exporter-jaeger@2.2.0
11:23:31.398 + @opentelemetry/winston-transport@0.17.0 (v0.18.0 available)
11:23:31.398 + @react-pdf/renderer@4.3.1
11:23:31.398 + @react-spring/web@9.7.5 (v10.0.3 available)
11:23:31.398 + @saintno/comfyui-sdk@0.2.49
11:23:31.398 + @serwist/next@9.2.1
11:23:31.398 + @t3-oss/env-nextjs@0.13.8
11:23:31.398 + @tanstack/react-query@5.90.5
11:23:31.398 + @trpc/client@11.6.0
11:23:31.398 + @trpc/next@11.6.0
11:23:31.399 + @trpc/react-query@11.6.0
11:23:31.399 + @trpc/server@11.6.0
11:23:31.399 + @vercel/analytics@1.5.0
11:23:31.399 + @vercel/edge-config@1.4.2
11:23:31.400 + @vercel/functions@3.1.4
11:23:31.400 + @vercel/speed-insights@1.2.0
11:23:31.400 + @virtuoso.dev/masonry@1.3.5
11:23:31.400 + @xterm/xterm@5.5.0
11:23:31.401 + ahooks@3.9.5
11:23:31.401 + antd@5.27.6
11:23:31.401 + antd-style@3.7.1
11:23:31.401 + brotli-wasm@3.0.1
11:23:31.402 + chroma-js@3.1.2
11:23:31.402 + cookie@1.0.2
11:23:31.402 + countries-and-timezones@3.8.0
11:23:31.402 + dayjs@1.11.18
11:23:31.402 + debug@4.4.3
11:23:31.402 + dexie@3.2.7 (v4.2.1 available)
11:23:31.403 + diff@8.0.2
11:23:31.403 + drizzle-orm@0.44.6
11:23:31.403 + drizzle-zod@0.5.1 (v0.8.3 available)
11:23:31.403 + epub2@3.0.2
11:23:31.403 + fast-deep-equal@3.1.3
11:23:31.403 + file-type@21.0.0
11:23:31.403 + framer-motion@12.23.24
11:23:31.403 + gpt-tokenizer@3.2.0
11:23:31.404 + gray-matter@4.0.3
11:23:31.404 + html-to-text@9.0.5
11:23:31.404 + i18next@25.6.0
11:23:31.404 + i18next-browser-languagedetector@8.2.0
11:23:31.404 + i18next-resources-to-backend@1.2.1
11:23:31.404 + idb-keyval@6.2.2
11:23:31.405 + immer@10.1.3
11:23:31.405 + jose@5.10.0 (v6.1.0 available)
11:23:31.405 + js-sha256@0.11.1
11:23:31.405 + jsonl-parse-stringify@1.0.3
11:23:31.405 + keyv@4.5.4 (v5.5.3 available)
11:23:31.405 + langchain@0.3.36 (v1.0.1 available)
11:23:31.405 + langfuse@3.38.6
11:23:31.406 + langfuse-core@3.38.6
11:23:31.406 + lodash-es@4.17.21
11:23:31.406 + lucide-react@0.544.0 (v0.546.0 available)
11:23:31.406 + mammoth@1.11.0
11:23:31.407 + markdown-to-txt@2.0.1
11:23:31.407 + marked@16.4.1
11:23:31.407 + mdast-util-to-markdown@2.1.2
11:23:31.407 + model-bank@workspace:packages/model-bank
11:23:31.407 + modern-screenshot@4.6.6
11:23:31.407 + nanoid@5.1.6
11:23:31.407 + next@16.0.0
11:23:31.407 + next-auth@5.0.0-beta.29
11:23:31.408 + next-mdx-remote@5.0.0
11:23:31.408 + nextjs-toploader@3.9.17
11:23:31.408 + node-machine-id@1.1.12
11:23:31.408 + numeral@2.0.6
11:23:31.409 + nuqs@2.7.2
11:23:31.409 + officeparser@5.1.1 (v5.2.1 available)
11:23:31.409 + oidc-provider@9.5.1
11:23:31.409 + ollama@0.6.0
11:23:31.410 + openai@4.104.0 (v6.6.0 available)
11:23:31.410 + openapi-fetch@0.14.1 (v0.15.0 available)
11:23:31.410 + partial-json@0.1.7
11:23:31.410 + path-browserify-esm@1.0.6
11:23:31.411 + pdf-parse@1.1.1 (v2.4.5 available)
11:23:31.411 + pdfjs-dist@4.8.69 (v5.4.296 available)
11:23:31.411 + pdfkit@0.17.2
11:23:31.412 + pg@8.16.3
11:23:31.412 + pino@9.14.0 (v10.1.0 available)
11:23:31.412 + plaiceholder@3.0.0
11:23:31.412 + polished@4.3.1
11:23:31.412 + posthog-js@1.278.0 (v1.279.3 available)
11:23:31.412 + pure-rand@7.0.1
11:23:31.412 + pwa-install-handler@2.6.3
11:23:31.412 + query-string@9.3.1
11:23:31.412 + random-words@2.0.1
11:23:31.412 + react@19.2.0
11:23:31.413 + react-confetti@6.4.0
11:23:31.413 + react-dom@19.2.0
11:23:31.413 + react-fast-marquee@1.6.5
11:23:31.413 + react-hotkeys-hook@5.2.1
11:23:31.414 + react-i18next@15.7.4 (v16.1.5 available)
11:23:31.414 + react-layout-kit@2.0.0
11:23:31.415 + react-lazy-load@4.0.1
11:23:31.415 + react-pdf@9.2.1 (v10.2.0 available)
11:23:31.415 + react-responsive@10.0.1
11:23:31.415 + react-rnd@10.5.2
11:23:31.415 + react-router-dom@7.9.4
11:23:31.415 + react-scan@0.4.3
11:23:31.415 + react-virtuoso@4.14.1
11:23:31.415 + react-wrap-balancer@1.1.1
11:23:31.415 + remark@15.0.1
11:23:31.416 + remark-gfm@4.0.1
11:23:31.417 + remark-html@16.0.1
11:23:31.417 + resolve-accept-language@3.1.13
11:23:31.417 + rtl-detect@1.1.2
11:23:31.417 + semver@7.7.3
11:23:31.417 + sharp@0.34.4
11:23:31.417 + shiki@3.13.0
11:23:31.417 + ssrf-safe-fetch@workspace:packages/ssrf-safe-fetch
11:23:31.417 + stripe@17.7.0 (v19.1.0 available)
11:23:31.417 + superjson@2.2.3
11:23:31.418 + svix@1.78.0
11:23:31.418 + swr@2.3.6
11:23:31.418 + systemjs@6.15.1
11:23:31.418 + tokenx@1.2.0
11:23:31.418 + ts-md5@2.0.1
11:23:31.419 + ua-parser-js@1.0.41 (v2.0.6 available)
11:23:31.420 + unstructured-client@0.19.0 (v0.28.0 available)
11:23:31.421 + url-join@5.0.0
11:23:31.421 + use-merge-value@1.2.0
11:23:31.421 + uuid@11.1.0 (v13.0.0 available)
11:23:31.421 + word-extractor@1.0.4
11:23:31.421 + ws@8.18.3
11:23:31.421 + yaml@2.8.1
11:23:31.421 + zod@3.25.76 (v4.1.12 available)
11:23:31.421 + zustand@5.0.4 (v5.0.8 available)
11:23:31.421 + zustand-utils@2.1.1
11:23:31.421 
11:23:31.421 3390 packages installed [119.77s]
11:23:31.421 
11:23:31.421 Blocked 10 postinstalls. Run `bun pm untrusted` for details.
11:23:31.581 Detected Next.js version: 16.0.0
11:23:31.582 Running "bun run build"
11:23:31.940 $ tsx scripts/prebuild.mts && bun run lint
11:23:32.965 [dotenv@17.2.3] injecting env (0) from .env -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit
11:23:32.966 Starting prebuild cleanup...
11:23:32.968 ♻️ Removed src/app/desktop successfully
11:23:32.969 ♻️ Removed src/app/(backend)/trpc/desktop successfully
11:23:32.969 Prebuild cleanup completed.
11:23:32.998 $ bun run lint:ts && bun run lint:style && bun run type-check && bun run lint:circular
11:23:33.002 $ eslint "{src,tests}/**/*.{js,jsx,ts,tsx}" --fix
11:24:18.865 $ stylelint "{src,tests}/**/*.{js,jsx,ts,tsx}" --fix
11:24:53.965 
11:24:53.965 Deprecation warnings:
11:24:53.965  - The "function-whitespace-after" rule is deprecated.
11:24:53.965  - The "media-feature-range-operator-space-after" rule is deprecated.
11:24:53.965  - The "media-feature-range-operator-space-before" rule is deprecated.
11:24:53.965 
11:24:54.019 $ tsgo --noEmit
11:25:19.162 $ bun run lint:circular:main && bun run lint:circular:packages
11:25:19.166 $ dpdm src/**/*.ts  --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular
11:25:19.292 

Start analyzing dependencies...
                                   
Start analyzing dependencies...
11:25:19.593Circular Dependencies
11:25:19.593 🚀 No circular dependencies found.
11:25:19.593 Analyze done!
11:25:19.600 $ dpdm packages/**/src/**/*.ts  --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular
11:25:19.723 

Start analyzing dependencies...
                                   
Start analyzing dependencies...
11:25:20.185Circular Dependencies
11:25:20.186 🚀 No circular dependencies found.
11:25:20.186 Analyze done!
11:25:20.192 $ cross-env NODE_OPTIONS=--max-old-space-size=6144 next build
11:25:21.696 [@serwist/next] WARNING: You are using '@serwist/next' with `next dev --turbopack`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set `disable` to `process.env.NODE_ENV !== "production"`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.
11:25:21.724 Attention: Next.js now collects completely anonymous telemetry regarding usage.
11:25:21.725 This information is used to shape Next.js' roadmap and prioritize features.
11:25:21.725 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
11:25:21.725 https://nextjs.org/telemetry
11:25:21.725 
11:25:21.747Next.js 16.0.0 (Turbopack)
11:25:21.748    - Experiments (use with caution):
11:25:21.748      · optimizePackageImports
11:25:21.748      ⨯ serverMinification
11:25:21.748      ✓ turbopackFileSystemCacheForDev
11:25:21.748      ✓ webpackBuildWorker
11:25:21.748      ✓ webpackMemoryOptimizations
11:25:21.748      · webVitalsAttribution
11:25:21.748 
11:25:21.848    Creating an optimized production build ...
11:25:22.780 [@serwist/next] WARNING: You are using '@serwist/next' with `next dev --turbopack`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set `disable` to `process.env.NODE_ENV !== "production"`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.
11:28:20.272 Turbopack build encountered 2 warnings:
11:28:20.272 ./node_modules/@opentelemetry/instrumentation/build/esm/platform/node
11:28:20.272 Package require-in-the-middle can't be external
11:28:20.272 The request require-in-the-middle matches serverExternalPackages (or the default list).
11:28:20.272 The package resolves to a different version when requested from the project directory (7.5.2) compared to the package requested from the importing module (8.0.1).
11:28:20.272 Make sure to install the same version of the package in both locations.
11:28:20.272 
11:28:20.272 
11:28:20.272 [externals]/node:buffer
11:28:20.272 unexpected export *
11:28:20.278 export * used with module [externals]/node:buffer [external] (node:buffer, cjs) which is a CommonJS module with exports only available at runtime
11:28:20.278 List all export names manually (`export { a, b, c } from "...") or rewrite the module to ESM, to avoid the additional runtime code.`
11:28:20.279 
11:28:20.279 Import trace:
11:28:20.279   external:
11:28:20.279     [externals]/node:buffer [external]
11:28:20.279     ./node_modules/jose/dist/node/esm/runtime/base64url.js [App Route]
11:28:20.279     ./node_modules/jose/dist/node/esm/key/import.js [App Route]
11:28:20.279     ./src/libs/oidc-provider/jwt.ts [App Route]
11:28:20.279     ./src/app/(backend)/middleware/auth/index.ts [App Route]
11:28:20.279     ./src/app/(backend)/webapi/text-to-image/[provider]/route.ts [App Route]
11:28:20.279 
11:28:20.279 
11:28:21.267Compiled successfully in 3.0min
11:28:21.267    Skipping validation of types
11:28:25.839    Collecting page data ...
11:28:31.450Using edge runtime on a page currently disables static generation for that page
11:28:34.056 Error [InvariantError]: Invariant: Unexpected match for a pathname "/en-US__1__dark/files/(.)[id]" with a param "id" of type "dynamic-intercepted". This is a bug in Next.js.
11:28:34.057     at ignore-listed frames
11:28:34.064 
11:28:34.065 > Build error occurred
11:28:34.068 Error: Failed to collect page data for /[variants]/files/(.)[id]
11:28:34.069     at ignore-listed frames {
11:28:34.069   type: 'Error'
11:28:34.069 }
11:28:34.158 error: script "build" exited with code 1
11:28:34.199 Error: Command "bun run build" exited with 1

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 24.10.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: 10.18.3
Relevant Packages:
  next: 15.3.5 // An outdated version detected (latest is 16.0.0), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/lobehub/lobe-chat/tree/reproduction/next-16

To Reproduce

  1. Clone the next-16 branch: git clone -b next-16 https://github.com/lobehub/lobe-chat.git
  2. Install dependencies: bun install (or pnpm install)
  3. Run production build: bun run build
  4. Build worker exits with InvariantError

Current vs. Expected behavior

in next 15.3.5 with webpack it works well. but when >15.4.0 it will meet OOM with webpack. in next 16 it just failed

here are the build log:

11:21:21.361 Running build in Washington, D.C., USA (East) – iad1
11:21:21.362 Build machine configuration: 4 cores, 8 GB
11:21:21.380 Cloning github.com/lobehub/lobe-chat (Branch: next-16, Commit: 8557880)
11:21:21.387 VERCEL_FORCE_NO_BUILD_CACHE is set so skipping build cache step
11:21:23.832 Cloning completed: 2.451s
11:21:24.623 Running "node scripts/vercelIgnoredBuildStep.js"
11:21:24.758 shouldBuild: true
11:21:24.758 
11:21:24.759- Build can proceed
11:21:24.759 
11:21:24.909 Running "vercel build"
11:21:25.344 Vercel CLI 48.2.9
11:21:26.085 Running "install" command: `npx bun@1.2.23 install`...
11:21:27.101 npm warn exec The following package was not found and will be installed: bun@1.2.23
11:21:31.605 bun install v1.2.23 (cf136713)
11:21:31.611 Resolving dependencies
11:22:07.045 Resolved, downloaded and extracted [12946]
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.046 warn: incorrect peer dependency "[email protected]"
11:22:07.046 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.047 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.047 
11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "@opentelemetry/[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.048 
11:22:07.048 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.049 
11:22:07.049 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "@octokit/[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.050 
11:22:07.050 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.051 warn: incorrect peer dependency "[email protected]"
11:22:07.051 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.052 
11:22:07.052 warn: incorrect peer dependency "[email protected]"
11:22:07.053 
11:22:07.053 warn: incorrect peer dependency "[email protected]"
11:22:07.053 
11:22:07.053 warn: incorrect peer dependency "[email protected]"
11:23:31.212 Saved lockfile
11:23:31.212 
11:23:31.212 $ husky
11:23:31.370 
11:23:31.370 + @commitlint/cli@19.8.1 (v20.1.0 available)
11:23:31.370 + @edge-runtime/vm@5.0.0
11:23:31.370 + @huggingface/tasks@0.19.58
11:23:31.374 + @lobechat/types@workspace:packages/types
11:23:31.374 + @lobehub/i18n-cli@1.25.1
11:23:31.374 + @lobehub/lint@1.26.2
11:23:31.374 + @lobehub/market-types@1.11.4
11:23:31.374 + @lobehub/seo-cli@1.7.0
11:23:31.374 + @next/bundle-analyzer@16.0.0-beta.0
11:23:31.374 + @next/eslint-plugin-next@15.5.6 (v16.0.0 available)
11:23:31.374 + @peculiar/webcrypto@1.5.0
11:23:31.374 + @playwright/test@1.56.1
11:23:31.374 + @prettier/sync@0.6.1
11:23:31.374 + @semantic-release/exec@6.0.3 (v7.1.0 available)
11:23:31.374 + @testing-library/jest-dom@6.9.1
11:23:31.374 + @testing-library/react@16.3.0
11:23:31.374 + @testing-library/user-event@14.6.1
11:23:31.374 + @types/chroma-js@3.1.1
11:23:31.374 + @types/crypto-js@4.2.2
11:23:31.374 + @types/debug@4.1.12
11:23:31.374 + @types/fs-extra@11.0.4
11:23:31.374 + @types/ip@1.1.3
11:23:31.374 + @types/json-schema@7.0.15
11:23:31.374 + @types/lodash@4.17.20
11:23:31.374 + @types/lodash-es@4.17.12
11:23:31.374 + @types/node@22.18.12 (v24.9.1 available)
11:23:31.374 + @types/numeral@2.0.5
11:23:31.375 + @types/oidc-provider@9.5.0
11:23:31.375 + @types/pdfkit@0.17.3
11:23:31.377 + @types/pg@8.15.5
11:23:31.377 + @types/react@19.2.2
11:23:31.377 + @types/react-dom@19.2.2
11:23:31.377 + @types/rtl-detect@1.0.3
11:23:31.377 + @types/semver@7.7.1
11:23:31.377 + @types/systemjs@6.15.3
11:23:31.377 + @types/ua-parser-js@0.7.39
11:23:31.378 + @types/unist@3.0.3
11:23:31.378 + @types/ws@8.18.1
11:23:31.379 + @typescript/native-preview@7.0.0-dev.20250711.1
11:23:31.379 + @vitest/coverage-v8@3.2.4 (v4.0.1 available)
11:23:31.380 + ajv-keywords@5.1.0
11:23:31.380 + commitlint@19.8.1 (v20.1.0 available)
11:23:31.380 + consola@3.4.2
11:23:31.381 + cross-env@10.1.0
11:23:31.381 + crypto-js@4.2.0
11:23:31.381 + dbdocs@0.16.2
11:23:31.381 + dotenv@17.2.3
11:23:31.381 + dotenv-expand@12.0.3
11:23:31.381 + dpdm-fast@1.0.14
11:23:31.382 + drizzle-dbml-generator@0.10.0
11:23:31.382 + drizzle-kit@0.31.5
11:23:31.383 + eslint@8.57.1 (v9.38.0 available)
11:23:31.383 + eslint-plugin-mdx@3.6.2
11:23:31.384 + fake-indexeddb@6.2.4
11:23:31.384 + fs-extra@11.3.2
11:23:31.385 + glob@11.0.3
11:23:31.386 + happy-dom@20.0.8
11:23:31.386 + husky@9.1.7
11:23:31.386 + import-in-the-middle@1.15.0 (v2.0.0 available)
11:23:31.389 + just-diff@6.0.2
11:23:31.389 + lint-staged@15.5.2 (v16.2.6 available)
11:23:31.389 + lodash@4.17.21
11:23:31.389 + markdown-table@3.0.4
11:23:31.389 + mcp-hello-world@1.1.2
11:23:31.389 + mime@4.1.0
11:23:31.389 + node-fetch@3.3.2
11:23:31.389 + node-gyp@11.5.0
11:23:31.389 + openapi-typescript@7.10.1
11:23:31.389 + p-map@7.0.3
11:23:31.389 + prettier@3.6.2
11:23:31.389 + remark-cli@12.0.1
11:23:31.389 + remark-frontmatter@5.0.0
11:23:31.389 + remark-mdx@3.1.1
11:23:31.389 + remark-parse@11.0.0
11:23:31.389 + require-in-the-middle@7.5.2 (v8.0.1 available)
11:23:31.389 + semantic-release@21.1.2 (v25.0.1 available)
11:23:31.389 + serwist@9.2.1
11:23:31.389 + stylelint@15.11.0 (v16.25.0 available)
11:23:31.389 + tsx@4.20.6
11:23:31.389 + type-fest@4.41.0 (v5.1.0 available)
11:23:31.389 + typescript@5.9.3
11:23:31.389 + unified@11.0.5
11:23:31.389 + unist-util-visit@5.0.0
11:23:31.389 + vite@7.1.11
11:23:31.389 + vitest@3.2.4 (v4.0.1 available)
11:23:31.390 + @ant-design/icons@5.6.1 (v6.1.0 available)
11:23:31.390 + @ant-design/pro-components@2.8.10
11:23:31.390 + @anthropic-ai/sdk@0.67.0
11:23:31.390 + @auth/core@0.40.0 (v0.41.0 available)
11:23:31.390 + @aws-sdk/client-s3@3.893.0 (v3.914.0 available)
11:23:31.391 + @aws-sdk/s3-request-presigner@3.893.0 (v3.914.0 available)
11:23:31.391 + @azure-rest/ai-inference@1.0.0-beta.5
11:23:31.391 + @azure/core-auth@1.10.1
11:23:31.391 + @cfworker/json-schema@4.1.1
11:23:31.392 + @clerk/localizations@3.26.3
11:23:31.392 + @clerk/nextjs@6.34.0
11:23:31.392 + @clerk/themes@2.4.29
11:23:31.392 + @codesandbox/sandpack-react@2.20.0
11:23:31.392 + @cyntler/react-doc-viewer@1.17.1
11:23:31.392 + @electric-sql/pglite@0.2.17 (v0.3.11 available)
11:23:31.392 + @emotion/react@11.14.0
11:23:31.392 + @fal-ai/client@1.7.0
11:23:31.392 + @formkit/auto-animate@0.9.0
11:23:31.392 + @google/genai@1.26.0
11:23:31.392 + @huggingface/inference@4.12.0
11:23:31.393 + @icons-pack/react-simple-icons@13.8.0
11:23:31.393 + @khmyznikov/pwa-install@0.3.9 (v0.5.8 available)
11:23:31.393 + @langchain/community@0.3.57 (v1.0.0 available)
11:23:31.393 + @lobechat/agent-runtime@workspace:packages/agent-runtime
11:23:31.393 + @lobechat/const@workspace:packages/const
11:23:31.393 + @lobechat/context-engine@workspace:packages/context-engine
11:23:31.394 + @lobechat/database@workspace:packages/database
11:23:31.394 + @lobechat/electron-client-ipc@workspace:packages/electron-client-ipc
11:23:31.394 + @lobechat/electron-server-ipc@workspace:packages/electron-server-ipc
11:23:31.394 + @lobechat/file-loaders@workspace:packages/file-loaders
11:23:31.394 + @lobechat/model-runtime@workspace:packages/model-runtime
11:23:31.394 + @lobechat/observability-otel@workspace:packages/obervability-otel
11:23:31.394 + @lobechat/prompts@workspace:packages/prompts
11:23:31.394 + @lobechat/python-interpreter@workspace:packages/python-interpreter
11:23:31.394 + @lobechat/utils@workspace:packages/utils
11:23:31.394 + @lobechat/web-crawler@workspace:packages/web-crawler
11:23:31.394 + @lobehub/analytics@1.6.0
11:23:31.394 + @lobehub/charts@2.1.2
11:23:31.394 + @lobehub/chat-plugin-sdk@1.32.4
11:23:31.394 + @lobehub/chat-plugins-gateway@1.9.0
11:23:31.394 + @lobehub/editor@1.21.0
11:23:31.394 + @lobehub/icons@2.43.1
11:23:31.394 + @lobehub/market-sdk@0.22.7
11:23:31.394 + @lobehub/tts@2.0.1
11:23:31.394 + @lobehub/ui@2.13.4
11:23:31.397 + @modelcontextprotocol/sdk@1.20.1
11:23:31.397 + @neondatabase/serverless@1.0.2
11:23:31.398 + @next/third-parties@16.0.0-beta.0
11:23:31.398 + @opentelemetry/exporter-jaeger@2.2.0
11:23:31.398 + @opentelemetry/winston-transport@0.17.0 (v0.18.0 available)
11:23:31.398 + @react-pdf/renderer@4.3.1
11:23:31.398 + @react-spring/web@9.7.5 (v10.0.3 available)
11:23:31.398 + @saintno/comfyui-sdk@0.2.49
11:23:31.398 + @serwist/next@9.2.1
11:23:31.398 + @t3-oss/env-nextjs@0.13.8
11:23:31.398 + @tanstack/react-query@5.90.5
11:23:31.398 + @trpc/client@11.6.0
11:23:31.398 + @trpc/next@11.6.0
11:23:31.399 + @trpc/react-query@11.6.0
11:23:31.399 + @trpc/server@11.6.0
11:23:31.399 + @vercel/analytics@1.5.0
11:23:31.399 + @vercel/edge-config@1.4.2
11:23:31.400 + @vercel/functions@3.1.4
11:23:31.400 + @vercel/speed-insights@1.2.0
11:23:31.400 + @virtuoso.dev/masonry@1.3.5
11:23:31.400 + @xterm/xterm@5.5.0
11:23:31.401 + ahooks@3.9.5
11:23:31.401 + antd@5.27.6
11:23:31.401 + antd-style@3.7.1
11:23:31.401 + brotli-wasm@3.0.1
11:23:31.402 + chroma-js@3.1.2
11:23:31.402 + cookie@1.0.2
11:23:31.402 + countries-and-timezones@3.8.0
11:23:31.402 + dayjs@1.11.18
11:23:31.402 + debug@4.4.3
11:23:31.402 + dexie@3.2.7 (v4.2.1 available)
11:23:31.403 + diff@8.0.2
11:23:31.403 + drizzle-orm@0.44.6
11:23:31.403 + drizzle-zod@0.5.1 (v0.8.3 available)
11:23:31.403 + epub2@3.0.2
11:23:31.403 + fast-deep-equal@3.1.3
11:23:31.403 + file-type@21.0.0
11:23:31.403 + framer-motion@12.23.24
11:23:31.403 + gpt-tokenizer@3.2.0
11:23:31.404 + gray-matter@4.0.3
11:23:31.404 + html-to-text@9.0.5
11:23:31.404 + i18next@25.6.0
11:23:31.404 + i18next-browser-languagedetector@8.2.0
11:23:31.404 + i18next-resources-to-backend@1.2.1
11:23:31.404 + idb-keyval@6.2.2
11:23:31.405 + immer@10.1.3
11:23:31.405 + jose@5.10.0 (v6.1.0 available)
11:23:31.405 + js-sha256@0.11.1
11:23:31.405 + jsonl-parse-stringify@1.0.3
11:23:31.405 + keyv@4.5.4 (v5.5.3 available)
11:23:31.405 + langchain@0.3.36 (v1.0.1 available)
11:23:31.405 + langfuse@3.38.6
11:23:31.406 + langfuse-core@3.38.6
11:23:31.406 + lodash-es@4.17.21
11:23:31.406 + lucide-react@0.544.0 (v0.546.0 available)
11:23:31.406 + mammoth@1.11.0
11:23:31.407 + markdown-to-txt@2.0.1
11:23:31.407 + marked@16.4.1
11:23:31.407 + mdast-util-to-markdown@2.1.2
11:23:31.407 + model-bank@workspace:packages/model-bank
11:23:31.407 + modern-screenshot@4.6.6
11:23:31.407 + nanoid@5.1.6
11:23:31.407 + next@16.0.0
11:23:31.407 + next-auth@5.0.0-beta.29
11:23:31.408 + next-mdx-remote@5.0.0
11:23:31.408 + nextjs-toploader@3.9.17
11:23:31.408 + node-machine-id@1.1.12
11:23:31.408 + numeral@2.0.6
11:23:31.409 + nuqs@2.7.2
11:23:31.409 + officeparser@5.1.1 (v5.2.1 available)
11:23:31.409 + oidc-provider@9.5.1
11:23:31.409 + ollama@0.6.0
11:23:31.410 + openai@4.104.0 (v6.6.0 available)
11:23:31.410 + openapi-fetch@0.14.1 (v0.15.0 available)
11:23:31.410 + partial-json@0.1.7
11:23:31.410 + path-browserify-esm@1.0.6
11:23:31.411 + pdf-parse@1.1.1 (v2.4.5 available)
11:23:31.411 + pdfjs-dist@4.8.69 (v5.4.296 available)
11:23:31.411 + pdfkit@0.17.2
11:23:31.412 + pg@8.16.3
11:23:31.412 + pino@9.14.0 (v10.1.0 available)
11:23:31.412 + plaiceholder@3.0.0
11:23:31.412 + polished@4.3.1
11:23:31.412 + posthog-js@1.278.0 (v1.279.3 available)
11:23:31.412 + pure-rand@7.0.1
11:23:31.412 + pwa-install-handler@2.6.3
11:23:31.412 + query-string@9.3.1
11:23:31.412 + random-words@2.0.1
11:23:31.412 + react@19.2.0
11:23:31.413 + react-confetti@6.4.0
11:23:31.413 + react-dom@19.2.0
11:23:31.413 + react-fast-marquee@1.6.5
11:23:31.413 + react-hotkeys-hook@5.2.1
11:23:31.414 + react-i18next@15.7.4 (v16.1.5 available)
11:23:31.414 + react-layout-kit@2.0.0
11:23:31.415 + react-lazy-load@4.0.1
11:23:31.415 + react-pdf@9.2.1 (v10.2.0 available)
11:23:31.415 + react-responsive@10.0.1
11:23:31.415 + react-rnd@10.5.2
11:23:31.415 + react-router-dom@7.9.4
11:23:31.415 + react-scan@0.4.3
11:23:31.415 + react-virtuoso@4.14.1
11:23:31.415 + react-wrap-balancer@1.1.1
11:23:31.415 + remark@15.0.1
11:23:31.416 + remark-gfm@4.0.1
11:23:31.417 + remark-html@16.0.1
11:23:31.417 + resolve-accept-language@3.1.13
11:23:31.417 + rtl-detect@1.1.2
11:23:31.417 + semver@7.7.3
11:23:31.417 + sharp@0.34.4
11:23:31.417 + shiki@3.13.0
11:23:31.417 + ssrf-safe-fetch@workspace:packages/ssrf-safe-fetch
11:23:31.417 + stripe@17.7.0 (v19.1.0 available)
11:23:31.417 + superjson@2.2.3
11:23:31.418 + svix@1.78.0
11:23:31.418 + swr@2.3.6
11:23:31.418 + systemjs@6.15.1
11:23:31.418 + tokenx@1.2.0
11:23:31.418 + ts-md5@2.0.1
11:23:31.419 + ua-parser-js@1.0.41 (v2.0.6 available)
11:23:31.420 + unstructured-client@0.19.0 (v0.28.0 available)
11:23:31.421 + url-join@5.0.0
11:23:31.421 + use-merge-value@1.2.0
11:23:31.421 + uuid@11.1.0 (v13.0.0 available)
11:23:31.421 + word-extractor@1.0.4
11:23:31.421 + ws@8.18.3
11:23:31.421 + yaml@2.8.1
11:23:31.421 + zod@3.25.76 (v4.1.12 available)
11:23:31.421 + zustand@5.0.4 (v5.0.8 available)
11:23:31.421 + zustand-utils@2.1.1
11:23:31.421 
11:23:31.421 3390 packages installed [119.77s]
11:23:31.421 
11:23:31.421 Blocked 10 postinstalls. Run `bun pm untrusted` for details.
11:23:31.581 Detected Next.js version: 16.0.0
11:23:31.582 Running "bun run build"
11:23:31.940 $ tsx scripts/prebuild.mts && bun run lint
11:23:32.965 [dotenv@17.2.3] injecting env (0) from .env -- tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit
11:23:32.966 Starting prebuild cleanup...
11:23:32.968 ♻️ Removed src/app/desktop successfully
11:23:32.969 ♻️ Removed src/app/(backend)/trpc/desktop successfully
11:23:32.969 Prebuild cleanup completed.
11:23:32.998 $ bun run lint:ts && bun run lint:style && bun run type-check && bun run lint:circular
11:23:33.002 $ eslint "{src,tests}/**/*.{js,jsx,ts,tsx}" --fix
11:24:18.865 $ stylelint "{src,tests}/**/*.{js,jsx,ts,tsx}" --fix
11:24:53.965 
11:24:53.965 Deprecation warnings:
11:24:53.965  - The "function-whitespace-after" rule is deprecated.
11:24:53.965  - The "media-feature-range-operator-space-after" rule is deprecated.
11:24:53.965  - The "media-feature-range-operator-space-before" rule is deprecated.
11:24:53.965 
11:24:54.019 $ tsgo --noEmit
11:25:19.162 $ bun run lint:circular:main && bun run lint:circular:packages
11:25:19.166 $ dpdm src/**/*.ts  --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular
11:25:19.292 

⠋ Start analyzing dependencies...
                                   
Start analyzing dependencies...
11:25:19.593 • Circular Dependencies
11:25:19.593 🚀 No circular dependencies found.
11:25:19.593 Analyze done!
11:25:19.600 $ dpdm packages/**/src/**/*.ts  --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular
11:25:19.723 

⠋ Start analyzing dependencies...
                                   
Start analyzing dependencies...
11:25:20.185 • Circular Dependencies
11:25:20.186 🚀 No circular dependencies found.
11:25:20.186 Analyze done!
11:25:20.192 $ cross-env NODE_OPTIONS=--max-old-space-size=6144 next build
11:25:21.696 [@serwist/next] WARNING: You are using '@serwist/next' with `next dev --turbopack`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set `disable` to `process.env.NODE_ENV !== "production"`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.
11:25:21.724 Attention: Next.js now collects completely anonymous telemetry regarding usage.
11:25:21.725 This information is used to shape Next.js' roadmap and prioritize features.
11:25:21.725 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
11:25:21.725 https://nextjs.org/telemetry
11:25:21.725 
11:25:21.747    ▲ Next.js 16.0.0 (Turbopack)
11:25:21.748    - Experiments (use with caution):
11:25:21.748      · optimizePackageImports
11:25:21.748      ⨯ serverMinification
11:25:21.748      ✓ turbopackFileSystemCacheForDev
11:25:21.748      ✓ webpackBuildWorker
11:25:21.748      ✓ webpackMemoryOptimizations
11:25:21.748      · webVitalsAttribution
11:25:21.748 
11:25:21.848    Creating an optimized production build ...
11:25:22.780 [@serwist/next] WARNING: You are using '@serwist/next' with `next dev --turbopack`, but Serwist doesn't support Turbopack at the moment. It is recommended that you set `disable` to `process.env.NODE_ENV !== "production"`. Follow https://github.com/serwist/serwist/issues/54 for progress on Serwist + Turbopack. You can also suppress this warning by setting SERWIST_SUPPRESS_TURBOPACK_WARNING=1.
11:28:20.272 Turbopack build encountered 2 warnings:
11:28:20.272 ./node_modules/@opentelemetry/instrumentation/build/esm/platform/node
11:28:20.272 Package require-in-the-middle can't be external
11:28:20.272 The request require-in-the-middle matches serverExternalPackages (or the default list).
11:28:20.272 The package resolves to a different version when requested from the project directory (7.5.2) compared to the package requested from the importing module (8.0.1).
11:28:20.272 Make sure to install the same version of the package in both locations.
11:28:20.272 
11:28:20.272 
11:28:20.272 [externals]/node:buffer
11:28:20.272 unexpected export *
11:28:20.278 export * used with module [externals]/node:buffer [external] (node:buffer, cjs) which is a CommonJS module with exports only available at runtime
11:28:20.278 List all export names manually (`export { a, b, c } from "...") or rewrite the module to ESM, to avoid the additional runtime code.`
11:28:20.279 
11:28:20.279 Import trace:
11:28:20.279   external:
11:28:20.279     [externals]/node:buffer [external]
11:28:20.279     ./node_modules/jose/dist/node/esm/runtime/base64url.js [App Route]
11:28:20.279     ./node_modules/jose/dist/node/esm/key/import.js [App Route]
11:28:20.279     ./src/libs/oidc-provider/jwt.ts [App Route]
11:28:20.279     ./src/app/(backend)/middleware/auth/index.ts [App Route]
11:28:20.279     ./src/app/(backend)/webapi/text-to-image/[provider]/route.ts [App Route]
11:28:20.279 
11:28:20.279 
11:28:21.267  ✓ Compiled successfully in 3.0min
11:28:21.267    Skipping validation of types
11:28:25.839    Collecting page data ...
11:28:31.450  ⚠ Using edge runtime on a page currently disables static generation for that page
11:28:34.056 Error [InvariantError]: Invariant: Unexpected match for a pathname "/en-US__1__dark/files/(.)[id]" with a param "id" of type "dynamic-intercepted". This is a bug in Next.js.
11:28:34.057     at ignore-listed frames
11:28:34.064 
11:28:34.065 > Build error occurred
11:28:34.068 Error: Failed to collect page data for /[variants]/files/(.)[id]
11:28:34.069     at ignore-listed frames {
11:28:34.069   type: 'Error'
11:28:34.069 }
11:28:34.158 error: script "build" exited with code 1
11:28:34.199 Error: Command "bun run build" exited with 1

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 65536
  Available CPU cores: 10
Binaries:
  Node: 24.10.0
  npm: 11.6.1
  Yarn: N/A
  pnpm: 10.18.3
Relevant Packages:
  next: 15.3.5 // An outdated version detected (latest is 16.0.0), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3

Which area(s) are affected? (Select all that apply)

Webpack, Turbopack

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed), next build (local)

Additional context

we also meet building OOM with next >=15.4.0. as LobeChat is a large-scale open-source Next.js application with ~200,000 lines of code. Due to the project's scale and complexity, we cannot provide a minimal reproduction repository. This issue only manifests in production-scale applications and cannot be easily isolated to a minimal reproduction.

extent analysis

TL;DR

The most likely fix for the InvariantError during the Next.js build process is to update the next configuration to properly handle dynamic routes and pathname matching.

Guidance

  1. Review dynamic routes: Ensure that all dynamic routes are properly defined and handled in the next configuration.
  2. Check pathname matching: Verify that the pathname matching for the route /en-US__1__dark/files/(.)[id] is correctly configured to handle the id parameter.
  3. Update next configuration: Consider updating the next configuration to use the latest features and fixes, such as the matcher option for handling dynamic routes.
  4. Monitor build process: Keep an eye on the build process and adjust the configuration as needed to prevent errors and optimize performance.
  5. Consider upgrading dependencies: Update dependencies like @serwist/next to the latest version to ensure compatibility with the latest next features.

Example

No specific code example can be provided without more context, but reviewing the next.config.js file and updating the dynamic route configuration may help resolve the issue.

Notes

  • The issue may be related to the large scale and complexity of the LobeChat application, making it difficult to isolate and reproduce the problem.
  • The error message suggests a bug in Next.js, but it's possible that the issue is specific to the application's configuration or dependencies.
  • Further investigation and debugging may be necessary to determine the root cause of the issue.

Recommendation

Apply a workaround by updating the next configuration to properly handle dynamic routes and pathname matching, and consider upgrading dependencies to ensure compatibility with the latest next features.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING