An error occurred during deployment. Please fix:
Running build in Washington, D.C., USA (East) – iad1
Build machine configuration: 2 cores, 8 GB
Retrieving list of deployment files...
Previous build caches not available.
Downloading 109 deployment files...
...
Error occurred prerendering page "/ai/contract-summarizer". Read more: https://nextjs.org/docs/messages/prerender-error
Export encountered an error on /(erp)/ai/contract-summarizer/page: /ai/contract-summarizer, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
ELIFECYCLE Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
错误是因为 ErpSidebar 使用了 useSearchParams(),在 Next.js 静态预渲染时需要用 Suspense 包裹,否则会让所有 ERP 页面预渲染失败。我来修复 layout:
已用 Suspense 包裹 ErpSidebar,因为它内部调用了 useSearchParams()。Next.js 在静态预渲染阶段要求这类钩子必须处于 Suspense 边界内,否则整个分支会被强制动态化并在 build 时报 prerender error。这样修复后所有 /ai/* 等占位页就能正常预渲染。
删除的页面留下了空目录,Next.js 解析路由时把空目录当成路由段导致编译错误。我来清理这些空目录:
空目录已全部清理(fleet、ship-archive、ship-config、ships、insurance、certificates 及子目录)。之前 Delete 只移除了文件却保留了目录,Next.js App Router 把空文件夹也当作潜在路由段,从而触发 module-not-found。现在 (erp) 下只剩有效的运营和 AI 路由,预览应能正常编译。