CLI 54.10.2 regression: functions pattern fails with custom Root Directory (worked on 54.9.0)

<!-- Questions that get answered the fastest are the ones with relevant info included in the original post. Be sure to include all detail needed to let others see and understand the problem! -->

Vercel CLI auto-bumped from 54.9.0 → 54.10.2 between 2026-06-08 21:32 ET and 2026-06-09 15:21 ET. After the bump, every build of my project fails in <4 seconds with:

Error: The pattern "api/index.js" defined in 'functions' doesn't match any Serverless Functions inside the 'api' directory. Error List

Vercel support reviewed this in chat and confirmed it appears to be a regression in how function-pattern matching resolves when a custom Root Directory is configured, but my Hobby plan blocked the engineering ticket form and sent me here.

<!-- Current versus Expected behavior -->

Expected: my project continues to build, exactly as it did on 2026-06-08 (the day before the CLI bump). Nothing in my repo or vercel.json changed across the success → failure boundary.

Current: every push fails in <4 seconds with the unmatched-function-pattern error. I have also redeployed an older commit from the still-green window (committed 2026-06-08 21:42 ET, i.e. 10 min after the last successful production build) with build cache disabled — same error. So the failure is purely a function of the CLI version, not anything in the code.

<!-- Code, configuration, and steps that reproduce this issue -->

Project structure:

  • Custom Root Directory: app
  • app/vercel.json:
{
  "functions": {
    "api/index.js": { "maxDuration": 60 }
  }
}
  • app/api/index.js — exists, committed, ~982KB CJS bundle, ends in module.exports = ...
  • app/api/package.json originally {"type":"commonjs"} to override parent app/package.json "type":"module"

Steps to reproduce:

  1. Push any commit to a project with the setup above
  2. Watch the build fail in <4s with the error

Things I tried that did NOT fix it:

  • Rename app/api/index.jsapp/api/index.cjs + update vercel.json + update build script — same error
  • Delete app/api/package.json — same error
  • Toggle Fluid Compute OFF in project settings — same error
  • Redeploy a known-good preview build with cache disabled — same error
<!-- Project information (URL, framework, environment, project settings) -->
  • Project: raven-chatbot-backend (team: shirazatz-devs-projects)
  • Live URL: https://www.askraven.app
  • Plan: Hobby
  • Framework Preset: Vite
  • Root Directory: app
  • Node.js Version: 24.x
  • Fluid Compute: Enabled (also tested with it disabled — same result)
  • Last green production deploy: dpl_HJNpjLZmoySUXUzPmB9zso2gZm1h (commit 08f8d14, 2026-06-08 21:32 ET, built on CLI 54.9.0)
  • First failed deploy: 2026-06-09 ~15:21 ET, built on CLI 54.10.2
  • Site is currently still serving the last green build, so users aren’t impacted, but I’m fully blocked from shipping any new code.

Happy to share additional deploy IDs or full build logs on request

Hi Shirazatz,

Your repro is already pretty strong, especially because an old green commit fails only after the CLI version changed.

One workaround I’d try is making the function pattern less dependent on the exact file path:

{
  "functions": {
    "api/**": {
      "maxDuration": 60
    }
  }
}

or, if Vercel accepts the JS glob in this setup:

{
  "functions": {
    "api/index.*": {
      "maxDuration": 60
    }
  }
}

The error is coming from the functions pattern check, not from your function code, so this test should tell you whether the regression is specifically around matching api/index.js under a custom Root Directory.

I’d also include a minimal public repro if possible:

repo/
  app/
    vercel.json
    api/
      index.js

with Root Directory set to app and only the functions config needed to trigger the failure.

If the broader glob works, you have a temporary unblock. If it still fails, that is useful evidence that the CLI is resolving the api directory from the wrong root.