最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error occurred prerendering page "". Deployment Error Vercel | Next.js - Stack Overflow

programmeradmin2浏览0评论

I am trying to deploy my site via Vercel and while generating static pages, it throws the below error in logs

info  - Generating static pages (0/6)
Error occurred prerendering page "/". Read more: 
Error: Minified React error #130; visit .html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at a.b.render (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:45:32)
    at a.b.read (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
    at Object.exports.renderToString (/vercel/path0/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
    at Object.renderPage (/vercel/path0/node_modules/next/dist/server/render.js:686:46)
    at Object.defaultGetInitialProps (/vercel/path0/node_modules/next/dist/server/render.js:316:51)
    at Function.getInitialProps (/vercel/path0/.next/server/pages/_document.js:514:20)
    at Object.loadGetInitialProps (/vercel/path0/node_modules/next/dist/shared/lib/utils.js:69:29)
    at renderDocument (/vercel/path0/node_modules/next/dist/server/render.js:699:48)
    at renderToHTML (/vercel/path0/node_modules/next/dist/server/render.js:774:34)
    at async /vercel/path0/node_modules/next/dist/export/worker.js:273:36
info  - Generating static pages (1/6)
[]
info  - Generating static pages (2/6)
info  - Generating static pages (4/6)
info  - Generating static pages (6/6)
> Build error occurred
Error: Export encountered errors on following paths:
    /
    at /vercel/path0/node_modules/next/dist/export/index.js:500:19
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:74:20)
    at async /vercel/path0/node_modules/next/dist/build/index.js:987:17
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:74:20)
    at async /vercel/path0/node_modules/next/dist/build/index.js:861:13
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:74:20)
    at async Object.build [as default] (/vercel/path0/node_modules/next/dist/build/index.js:82:25)
error Command failed with exit code 1.
info Visit  for documentation about this mand.
Error: Command "yarn run build" exited with 1

I've tried to fix it by using the Prerender error guide Next.js provided but still wasn't able to fix it.

My pages directory structure is below

发布评论

评论列表(0)

  1. 暂无评论