【问题标题】:NextJs vercel deployment error "routes-manifest.json" couldn't be foundNextJs vercel 部署错误“routes-manifest.json”找不到
【发布时间】:2022-03-31 02:16:29
【问题描述】:

我的 nextjs 应用程序运行正常我添加了一些文件来更新我的代码,现在它没有在 vercel 上部署我的应用程序。给出这个错误

我尝试用谷歌搜索错误,但我的情况是独一无二的。

这是 git 仓库 https://github.com/usman-174/google-calendar-frontend

这些是我在 package.json 中的脚本标签

 "scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"export": "next export",
"lint": "next lint",
"lint-fix": "next lint --fix"
},

next.config.js

module.exports = {
distDir: 'build',
}

【问题讨论】:

    标签: node.js reactjs deployment next.js vercel


    【解决方案1】:
    1. 运行 npm run build(检查构建文件夹中的所有文件)
    2. 创建 .next 文件夹并将所有文件从 build 文件夹移动到 .next
    3. 将 .next 文件夹提交到 vercel 或 git。

    【讨论】:

      【解决方案2】:

      我也遇到了这个错误,因为我的应用程序的根目录不在我的 Git 存储库的顶级目录中,所以 Vercel 无法找到 .next 文件夹。

      我通过转到我的 Vercel 项目的 Vercel 仪表板来修复它,然后 -> Settings -> General 并将 Root Directory 设置为我的应用程序的子目录路径:

      【讨论】:

        猜你喜欢
        • 2021-04-22
        • 2023-03-03
        • 2022-01-02
        • 1970-01-01
        • 2021-08-01
        • 2023-01-18
        • 2022-01-17
        • 1970-01-01
        • 2022-01-13
        相关资源
        最近更新 更多