Turborepo and Vercel build issue ENOENT: no such file or directory

Thanks for the response! I think I saw the same message duplicated in another thread. But could you clarify what you mean by “deploy layer”? If there’s documentation on how to configure this, I’d appreciate a link.


Update: I believe I found the root cause

I had numerous packages listed in serverExternalPackages in my next.config.ts that are no longer needed in our application. This may also be related to recent improvements in Turbopack’s bundling behavior.

After removing these entries, the build appears to work correctly:

const nextConfig = {
  //...
  serverExternalPackages: [
     "pino",
      "pino-pretty",
      // Fix bundling warnings for legacy packages
      "fstream",
      "rimraf",
      "glob",
      "minimatch",
      "brace-expansion",
      // ExcelJS and its dependencies
      "exceljs",
      "jszip",
      "lie",
      "unzipper",
      "minimatch",
      "graphql",
      "@aws-amplify/pubsub",
      "@aws-amplify/api-graphql",
      "@sentry/node",
  ]
}

export default nextConfig;

This fix isn’t 100% confirmed yet, but I’ll monitor the builds throughout the day and update if I encounter any issues.

1 Like