我正在尝试在 Vercel 上部署我的 NextJS 应用程序,但构建总是失败并显示错误 ReferenceError: NowBuildError is not defined
,即使 NextJS 应用程序已成功构建。我已经联系了 Vercel 支持,但他们只能在我公开存储库的情况下帮助我,不幸的是,这不是一个选项。我已经让他们向他们发送整个项目的 ZIP 文件,但他们没有接受。
我在这里发布这个是希望有人知道是什么导致了这个错误。任何想法都非常感谢。
编辑:这是一个重现错误的存储库:https://github.com/omnibrain/vercel-bug
我已经通过这个 repo 再次联系了 Vercel 支持。一旦我得到答案,我就会为下一个遇到此错误的可怜人更新这个问题。
构建的相关日志:
14:39:30.028 info - Using external babel configuration from /vercel/workpath3/.babelrc
14:39:55.285 info - Compiled successfully
14:39:55.286 info - Collecting page data...
14:39:56.273 info - Generating static pages (0/2)
14:39:56.757 info - Generating static pages (2/2)
14:39:56.757 info - Finalizing page optimization...
14:39:56.785 Page Size First Load JS
14:39:56.785 ┌ λ / 662 B 299 kB
14:39:56.785 ├ /_app 0 B 146 kB
14:39:56.785 ├ ○ /404 1.21 kB 148 kB
14:39:56.786 ├ ○ /conversation/[conversationId] 3.31 kB 302 kB
14:39:56.786 └ λ /topic/[topicId] 13.2 kB 312 kB
14:39:56.786 + First Load JS shared by all 146 kB
14:39:56.786 ├ chunks/ab9efbc8d7cf444f2a1dec397df8d1d8182e9a7f.3290e1.js 23.6 kB
14:39:56.786 ├ chunks/cb0f0b62e252180070876650b5cd91101d837ec4.ec6bad.js 2.17 kB
14:39:56.786 ├ chunks/commons.6e164c.js 14.3 kB
14:39:56.786 ├ chunks/ff239f9d.d2e033.js 56.4 kB
14:39:56.787 ├ chunks/framework.009b20.js 40.5 kB
14:39:56.787 ├ chunks/main.c4bc76.js 6.47 kB
14:39:56.787 ├ chunks/pages/_app.08216f.js 1.59 kB
14:39:56.787 └ chunks/webpack.4cbdc2.js 1.22 kB
14:39:56.787 λ (Lambda) server-side renders at runtime (uses getInitialProps or getServerSideProps)
14:39:56.787 ○ (Static) automatically rendered as static HTML (uses no initial props)
14:39:56.787 ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
14:39:56.788 (ISR) incremental static regeneration (uses revalidate in getStaticProps)
14:39:56.788 Next.js Analytics is enabled for this production build. You'll receive a Real Experience Score computed by all of your visitors.
14:39:56.954 Done in 39.89s.
14:40:13.098 Traced Next.js serverless functions for external files in: 16118.239ms
14:40:16.248 Compressed shared serverless function files: 3149.457ms
14:40:16.552 All serverless functions created in: 301.819ms
14:40:28.090 ReferenceError: NowBuildError is not defined
14:40:28.091 at retry.retries (/var/task/sandbox-worker.js:116373:9)
14:40:28.091 at processTicksAndRejections (internal/process/task_queues.js:97:5)
14:40:28.091 at async patchBuild (/var/task/sandbox-worker.js:116310:10)
14:40:28.091 at async patchBuildToUploading (/var/task/sandbox-worker.js:117471:47)
14:40:28.091 at async /var/task/sandbox-worker.js:116998:39
14:40:32.901 Done with "package.json"
14:40:33.608 Build completed. Populating build cache...
14:41:06.395 Uploading build cache [79.95 MB]...
14:41:11.186 Build cache uploaded: 4791.125ms
14:41:11.419 Done with "api/analytics.ts"
答案 0 :(得分:0)
事实证明这是 Vercel 方面的错误。他们已经修复了错误,现在一切都恢复了。