但是,在本地,我能够执行npm run dev,但是,当我试图将代码部署到vercel时,我会得到以下错误:
Error: Export encountered errors on following paths:
/
/404
/500
at /vercel/path0/node_modules/next/dist/export/index.js:493: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:970: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:844: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)发布于 2021-12-01 14:13:01
如何在vercel上清楚地部署
environment vercel variables (信息)。检查是否正确设置了production && preview & development变量。npm run build,如果它不能工作,请检查point 1.env文件。您的.env文件不会在github上导出,因此vercel无法从.env文件中获取数据。这一点意味着您只需要将您的.env数据存储为string和numbers,而不需要根据您的环境进行复杂的代码存储。errors和warnings。在您共享的代码中,400和500页面有一些问题'red'文件。例如,在VScode中,任何显示红色的页面在部署期间都将是throw vercel error,即使您的本地代码工作正常。https://stackoverflow.com/questions/70185127
复制相似问题