Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.35 KB

now-next-no-serverless-pages-built.md

File metadata and controls

49 lines (34 loc) · 1.35 KB

@vercel/next No Serverless Pages Built

Why This Error Occurred

This error occurs when your application is not configured for Serverless Next.js build output.

Possible Ways to Fix It

In order to create the smallest possible lambdas Next.js has to be configured to build for the serverless target.

  1. Serverless Next.js requires Next.js 8 or later, to upgrade you can install the latest version:
npm install next --save
  1. Check Node.js Version in your Project Settings. Using an old or incompatible version of Node.js can cause the Build Step to fail with this error message.

  2. Add the now-build script to your package.json [deprecated]

{
  "scripts": {
    "now-build": "next build"
  }
}
  1. Add target: 'serverless' to next.config.js [deprecated]
module.exports = {
  target: 'serverless',
  // Other options
};
  1. Remove distDir from next.config.js as @vercel/next can't parse this file and expects your build output at /.next

  2. Optionally make sure the "src" in "builds" points to your application package.json

{
  "version": 2,
  "builds": [{ "src": "package.json", "use": "@vercel/next" }]
}
  1. Make sure you have the correct Node.js version selected for your build step in your project settings (https://vercel.com/[username]/[project]/settings)