I am using Node.js v22.9.0 and have configured the vercel project to use node 22.x
My project builds and runs locally successfully
However a deployment build fails with this error:
[20:13:04.479] Running build in Washington, D.C., USA (East) – iad1
[20:13:04.612] Cloning github.com/dcs3spp/my-fumadocs-app (Branch: main, Commit: 1a755f7)
[20:13:04.768] Previous build caches not available
[20:13:05.319] Cloning completed: 707.000ms
[20:13:05.981] Running "vercel build"
[20:13:06.469] Vercel CLI 41.4.1
[20:13:08.999] Detected `pnpm-lock.yaml` 9 which may be generated by pnpm@9.x or pnpm@10.x
[20:13:09.000] Using pnpm@10.x based on project creation date
[20:13:09.001] To use pnpm@9.x, manually opt in using corepack (https://vercel.com/docs/deployments/configure-a-build#corepack)
[20:13:09.021] Installing dependencies...
[20:13:09.745] Lockfile is up to date, resolution step is skipped
[20:13:09.868] Progress: resolved 1, reused 0, downloaded 0, added 0
[20:13:09.960] Packages: +723
[20:13:09.961] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[20:13:10.869] Progress: resolved 723, reused 0, downloaded 30, added 16
[20:13:11.870] Progress: resolved 723, reused 0, downloaded 58, added 42
[20:13:12.871] Progress: resolved 723, reused 0, downloaded 150, added 135
[20:13:13.873] Progress: resolved 723, reused 0, downloaded 276, added 269
[20:13:14.873] Progress: resolved 723, reused 0, downloaded 294, added 283
[20:13:16.083] Progress: resolved 723, reused 0, downloaded 295, added 283
[20:13:17.085] Progress: resolved 723, reused 0, downloaded 300, added 287
[20:13:18.086] Progress: resolved 723, reused 0, downloaded 310, added 294
[20:13:19.153] Progress: resolved 723, reused 0, downloaded 310, added 295
[20:13:20.153] Progress: resolved 723, reused 0, downloaded 322, added 308
[20:13:21.153] Progress: resolved 723, reused 0, downloaded 434, added 424
[20:13:22.154] Progress: resolved 723, reused 0, downloaded 475, added 463
[20:13:23.154] Progress: resolved 723, reused 0, downloaded 646, added 632
[20:13:24.156] Progress: resolved 723, reused 0, downloaded 698, added 685
[20:13:25.156] Progress: resolved 723, reused 0, downloaded 720, added 704
[20:13:25.569] Progress: resolved 723, reused 0, downloaded 723, added 723, done
[20:13:25.804] .../esbuild@0.25.1/node_modules/esbuild postinstall$ node install.js
[20:13:25.804] .../sharp@0.33.5/node_modules/sharp install$ node install/check
[20:13:25.914] .../esbuild@0.25.1/node_modules/esbuild postinstall: Done
[20:13:26.109] .../sharp@0.33.5/node_modules/sharp install: Done
[20:13:26.243]
[20:13:26.243] dependencies:
[20:13:26.243] + @supabase/supabase-js 2.49.1
[20:13:26.243] + @theguild/remark-mermaid 0.2.0
[20:13:26.243] + aos 2.3.4
[20:13:26.243] + fumadocs-core 15.1.0
[20:13:26.243] + fumadocs-mdx 11.5.6
[20:13:26.245] + fumadocs-ui 15.1.0
[20:13:26.245] + lucide-react 0.482.0
[20:13:26.245] + next 15.2.2
[20:13:26.245] + react 19.0.0
[20:13:26.245] + react-dom 19.0.0
[20:13:26.245] + shiki 3.2.1
[20:13:26.245] + simple-icons 14.11.0
[20:13:26.245] + zod 3.24.2
[20:13:26.245]
[20:13:26.249] devDependencies:
[20:13:26.249] + @eslint/js 9.22.0
[20:13:26.249] + @fumadocs/cli 0.0.8
[20:13:26.249] + @next/eslint-plugin-next 15.2.2
[20:13:26.249] + @tailwindcss/postcss 4.0.14
[20:13:26.249] + @types/aos 3.0.7
[20:13:26.249] + @types/mdx 2.0.13
[20:13:26.249] + @types/node 22.13.10
[20:13:26.249] + @types/react 19.0.10
[20:13:26.249] + @types/react-dom 19.0.4
[20:13:26.249] + autoprefixer 10.4.21
[20:13:26.249] + eslint 9.22.0
[20:13:26.249] + eslint-plugin-react 7.37.4
[20:13:26.249] + eslint-plugin-react-hooks 5.2.0
[20:13:26.250] + fast-glob 3.3.3
[20:13:26.250] + gray-matter 4.0.3
[20:13:26.250] + next-validate-link 1.5.2
[20:13:26.250] + postcss 8.5.3
[20:13:26.250] + rimraf 6.0.1
[20:13:26.250] + tailwindcss 4.0.14
[20:13:26.250] + tsx 4.19.3
[20:13:26.250] + typescript 5.8.2
[20:13:26.250] + typescript-eslint 8.26.1
[20:13:26.250]
[20:13:26.268] Done in 17s using pnpm v10.6.2
[20:13:26.290] Detected Next.js version: 15.2.2
[20:13:26.343] Running "pnpm run build"
[20:13:26.656]
[20:13:26.656] > my-fumadocs-app@0.0.0 build /vercel/path0
[20:13:26.656] > next build
[20:13:26.656]
[20:13:27.622] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[20:13:27.623] This information is used to shape Next.js' roadmap and prioritize features.
[20:13:27.623] 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:
[20:13:27.623] https://nextjs.org/telemetry
[20:13:27.624]
[20:13:27.711] ▲ Next.js 15.2.2
[20:13:27.712]
[20:13:27.976] Creating an optimized production build ...
[20:13:28.545] [MDX] update map file: 448.792ms
[20:14:05.961] Failed to compile.
[20:14:05.961]
[20:14:05.962] ./app/docs/[[...slug]]/page.tsx
[20:14:05.962] Module not found: Can't resolve '@/lib/metadata'
[20:14:05.962]
[20:14:05.962] https://nextjs.org/docs/messages/module-not-found
[20:14:05.962]
[20:14:05.962] ./app/docs/[[...slug]]/page.tsx
[20:14:05.962] Module not found: Can't resolve '@/lib/metadata-image'
[20:14:05.963]
[20:14:05.963] https://nextjs.org/docs/messages/module-not-found
[20:14:05.963]
[20:14:05.964] ./app/sitemap.ts
[20:14:05.964] Module not found: Can't resolve '@/lib/metadata'
[20:14:05.964]
[20:14:05.964] https://nextjs.org/docs/messages/module-not-found
[20:14:05.964]
[20:14:05.964] Import trace for requested module:
[20:14:05.964] ./node_modules/.pnpm/next@15.2.2_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/next/dist/build/webpack/loaders/next-metadata-route-loader.js?filePath=%2Fvercel%2Fpath0%2Fapp%2Fsitemap.ts&isDynamicRouteExtension=1!?__next_metadata_route__
[20:14:05.965]
[20:14:05.965]
[20:14:05.965] > Build failed because of webpack errors
[20:14:06.048] ELIFECYCLE Command failed with exit code 1.
[20:14:06.070] Error: Command "pnpm run build" exited with 1
[20:14:06.928]