An unexpected error happened when running this build

Build Completed in /vercel/output [2m]
Deploying outputs...
An unexpected error happened when running this build. We have been notified of the problem. This may be a transient error. If the problem persists, please contact Vercel Support https://vercel.com/help
{
  "framework": "nextjs",
  "functions": {
    "api/linkedin/routes/*.py": {
      "runtime": "@vercel/python@2.0.1",
      "memory": 1024,
      "maxDuration": 10
    }
  }
}

https://vercel.com/thewbuks-projects/scoutly/4sM2CrStuQUwDPov4nMK1GL6Vi8C?filter=errors

Using Node 18.

requirements.txt in root

flask==2.0.1
linkedin-api==2.0.3
python-dotenv==0.19.0 

Hi, @thewbuk! Welcome :wave:

Here’s a solution from another thread - could be helpful in your case?

1 Like

Hi @pawlean

How do I check bundle size?

I also run full vercel build -d locally. Output:

Traced Next.js server files in: 571.778ms
Created all serverless functions in: 3.206s
Collected static files (public/, static/, .next/static): 12.828ms
> [debug] [2025-02-03T12:59:52.140Z] Setting env VERCEL_PROJECT_SETTINGS_NODE_VERSION to "18.x"
> [debug] [2025-02-03T12:59:52.141Z] Building entrypoint "api/linkedin/routes/index.py" with "@vercel/python"
Installing required dependencies...
> [debug] [2025-02-03T13:00:44.343Z] Setting env VERCEL_PROJECT_SETTINGS_NODE_VERSION to "18.x"
> [debug] [2025-02-03T13:00:44.343Z] Building entrypoint "api/start-dev.py" with "@vercel/python"
Installing required dependencies...
Error: EMFILE: too many open files, open 'C:\Users\wojte\Desktop\Projects\codium\.vercel\output\functions\api\start-dev.func\.vercel\output\functions\api\parse-cv.func\node_modules\.pnpm\stripe@17.6.0\node_modules\stripe\esm\resources\Quotes.js'
> [debug] [2025-02-03T13:04:18.456Z] Error: EMFILE: too many open files, open 'C:\Users\wojte\Desktop\Projects\codium\.vercel\output\builds.json'
Error: EMFILE: too many open files, open 'C:\Users\wojte\Desktop\Projects\codium\.vercel\output\builds.json'
> [debug] [2025-02-03T13:04:18.458Z] Spawning C:\Users\wojte\AppData\Roaming\npm\node_modules\vercel\dist\get-latest-worker.js
> '[debug] [2025-02-03T13:04:18.511Z] Notifying parent we're ready
> '[debug] [2025-02-03T13:04:18.518Z] Received message from parent: {
  cacheFile: 'C:\\Users\\wojte\\AppData\\Local\\com.vercel.cli\\Cache\\package-updates\\vercel-latest.json',
  distTag: 'latest',
  name: 'vercel',
  updateCheckInterval: 86400000
}
> '[debug] [2025-02-03T13:04:18.518Z] Disconnecting from parent
> '[debug] [2025-02-03T13:04:18.520Z] Checking lock file: C:\Users\wojte\AppData\Local\com.vercel.cli\Cache\package-updates\vercel-latest.lock    
> '[debug] [2025-02-03T13:04:18.521Z] Found lock file with pid: 51084
> '[debug] [2025-02-03T13:04:18.521Z] Resetting lock file: Error: kill ESRCH
> '[debug] [2025-02-03T13:04:18.522Z] Initializing lock file with pid 30308
> '[debug] [2025-02-03T13:04:18.523Z] Fetching https://registry.npmjs.org/-/package/vercel/dist-tags
> '[debug] [2025-02-03T13:04:19.018Z] Found dist tag "latest" with version "40.1.0"
> '[debug] [2025-02-03T13:04:19.018Z] Writing cache file: C:\Users\wojte\AppData\Local\com.vercel.cli\Cache\package-updates\vercel-latest.json    
> '[debug] [2025-02-03T13:04:19.020Z] Releasing lock file: C:\Users\wojte\AppData\Local\com.vercel.cli\Cache\package-updates\vercel-latest.lock   
> '[debug] [2025-02-03T13:04:19.021Z] Worker finished successfully!

Thank it just hangs there

Also is there available list of python runtimes config:

"runtime": "@vercel/python@2.0.1",

Works.

"runtime": "@vercel/python@3.12",

Does not .

Using the Python Runtime with Serverless Functions says nothing about vercel.json config

Used withBundleAnalyzer and I believe I’m well under any limits

Node: 3.51 MB
Edge 188KB
Client: 2.32 MB

Ok I fixed it:

Only left

{
  "framework": "nextjs"
}

in vercel.json

and specified

python_version >= "3.9"

in requirements.txt in root

1 Like

Ah, thanks for sharing what worked for you @thewbuk!