2

I recently moved a Nextjs project to Zeit platform. Until I configured environment setup I could deploy with no issue. After the environment setup which is very minimal as

{
"version": 2,
"name": "<....>",
"alias": "<...>",
"routes": [
    {
        "src": "^/service-worker.js$",
        "dest": "/_next/public/service-worker.js",
        "headers": {
            "cache-control": "public, max-age=43200, immutable",
            "Service-Worker-Allowed": "/"
        }
    }
],
"builds": [{ "src": "package.json", "use": "@now/next" }],
"env": {
    "SENTRY_DNS": "<...>",
    "DEV_BASE_URL": "<...>",
    "PROD_BASE_URL": "<...>",
    "NODE_ENV": "<...>"
}

}

I get this error when I deploy

Deployment Error

As seen in the stub configuration, I have no server API setup, so I am confused about what could cause the function count

Ndifreke
  • 732
  • 1
  • 8
  • 13

1 Answers1

1

I had this same issue just trying to deploy my app for the first time. I believe every /pages creates a serverless function. There's some info on it here: https://vercel.com/docs/v2/serverless-functions/introduction

I tried removing some of my pages to test the theory and was able to get ti deploying by cutting down to 12 pages.

Abby
  • 3,169
  • 1
  • 21
  • 40
  • I had the same problem. I also removed some of my index per page on api folder. What is the correct use of serverless function anyway? I have several function that fetch on the database. – keisaac May 10 '20 at 14:18