vercel deploy next.js error All In One
<h1 id="vercel-deploy-nextjs-error-all-in-one">vercel deploy next.js error All In One</h1><p><img src="https://img2023.cnblogs.com/blog/740516/202212/740516-20221202000539416-113182570.png" alt="image" loading="lazy"></p>
<p>https://vercel.com/web-full-stack/nextjs-ssr/deployments</p>
<h2 id="bug">bug</h2>
<pre><code class="language-md"> Cloning github.com/web-full-stack/nextjs-ssr (Branch: main, Commit: 4124ea8)
Cloning completed: 715.86ms
Restored build cache
Running "vercel build"
Vercel CLI 28.6.0
Installing dependencies...
changed 1 package in 1s
Detected Next.js version: 13.0.3
Detected `package-lock.json` generated by npm 7+...
Running "npm run build"
> nextjs@0.1.0 build
> next build
info- Linting and checking validity of types...
info- Creating an optimized production build...
info- Compiled successfully
info- Collecting page data...
✅ __dirname = /vercel/posts
❌ process.cwd() = /vercel/path0
❌ postsDirectory = /vercel/path0/posts
✅ __dirname = /vercel/posts
❌ process.cwd() = /vercel/path0
❌ postsDirectory = /vercel/path0/posts
🚧 filename = 2021/01/01/first
🚧 filename = 2022/11/01/first
🚧 filename = 2022/11/30/last
🚧 filename = 2022/12/01/first
🚧 filename = 2022/12/31/last
ids = [
{
id: '/vercel/path0/posts/2021/01/01/first.md',
year: '2021',
month: '01',
day: '01',
title: 'first'
},
{
id: '/vercel/path0/posts/2022/11/01/first.md',
year: '2022',
month: '11',
day: '01',
title: 'first'
},
{
id: '/vercel/path0/posts/2022/11/30/last.md',
year: '2022',
month: '11',
day: '30',
title: 'last'
},
{
id: '/vercel/path0/posts/2022/12/01/first.md',
year: '2022',
month: '12',
day: '01',
title: 'first'
},
{
id: '/vercel/path0/posts/2022/12/31/last.md',
year: '2022',
month: '12',
day: '31',
title: 'last'
}
]
Error: A required parameter (date-string) was not provided as a string in getStaticPaths for /posts//
at /vercel/path0/node_modules/next/dist/build/utils.js:656:27
at Array.forEach (<anonymous>)
at /vercel/path0/node_modules/next/dist/build/utils.js:649:29
at Array.forEach (<anonymous>)
at buildStaticPaths (/vercel/path0/node_modules/next/dist/build/utils.js:620:17)
at async /vercel/path0/node_modules/next/dist/build/utils.js:929:115
at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
> Build error occurred
Error: Failed to collect page data for /posts//
at /vercel/path0/node_modules/next/dist/build/utils.js:959:15 {
type: 'Error'
}
Error: Command "npm run build" exited with 1
</code></pre>
<p>https://vercel.com/web-full-stack/nextjs-ssr/GMZPJs1r5cNd7pYSQMEzKZr22W7D</p>
<h2 id="deployments-environment">deployments environment</h2>
<p><img src="https://img2023.cnblogs.com/blog/928074/202212/928074-20221202003407690-513819180.png" alt="" loading="lazy"></p>
<p>https://github.com/web-full-stack/nextjs-ssr/deployments</p>
<p><img src="https://img2023.cnblogs.com/blog/928074/202212/928074-20221202003530281-1976228194.png" alt="" loading="lazy"></p>
<p>https://github.com/web-full-stack/nextjs-ssr/deployments/activity_log?environment=Production</p>
<p>https://github.com/web-full-stack/nextjs-ssr/deployments/activity_log?environment=Preview</p>
<h2 id="solution-">solution ✅</h2>
<pre><code class="language-js">const fsp = require('fs').promises;
// fsp.readdir
const fs = require('fs');
// fs.readFileSync
</code></pre>
<p><img src="https://img2023.cnblogs.com/blog/740516/202212/740516-20221202025311627-1495463562.png" alt="image" loading="lazy"></p>
<p>https://github.com/web-full-stack/nextjs-ssr/commit/3f6c8ec13cf9c3b51ebd5a47cbe119024cfa8d9d</p>
<h2 id="--反爬虫测试打击盗版️如果你看到这个信息-说明这是一篇剽窃的文章请访问-httpswwwcnblogscomxgqfrms-查看原创文章"><div id="anti-crawler" style="color: rgba(255, 0, 0, 1)"> (🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!</div></h2>
<h2 id="demo">demo</h2>
<p><img src="https://img2023.cnblogs.com/blog/740516/202302/740516-20230214233158957-1243449727.png" alt="image" loading="lazy"></p>
<p>https://nextjs-ssr.xgqfrms.xyz/</p>
<p>https://github.com/xgqfrms/ssr-next</p>
<p>https://github.com/web-full-stack/nextjs-ssr</p>
<h2 id="refs">refs</h2>
<p>https://github.com/vercel/next.js/issues/43528</p>
<hr>
<div>
</div>
<hr>
<blockquote style="display: flex; flex-flow: column; align-items: center; justify-content: center; text-align: center; border: none">
<h3><strong><span style="font-size: 16pt; color: rgba(0, 255, 0, 1)">©xgqfrms 2012-<span data-uid="copyright-aside">2021</span></span></strong>
<p><span style="font-size: 18pt; color: rgba(0, 255, 0, 1)"><strong>www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!</strong></span></p>
<p><span style="font-size: 18pt; color: rgba(0, 255, 0, 1)"><strong>原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!</strong></span></p>
</h3></blockquote>
<hr>
</div>
<div id="MySignature" role="contentinfo">
<div style="display: flex; flex-flow: column nowrap; align-items: center; justify-content: center;">
<p>本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/16943213.html</p>
<p style="color: red; font-size: 23px; margin-top: 5px; margin-botom: 5px;">未经授权禁止转载,违者必究!</P>
</div>
<hr/><br><br>
来源:https://www.cnblogs.com/xgqfrms/p/16943213.html
頁:
[1]