Pattern in `functions` doesn't match any Serverless Functions

Note: My application runs under npm run dev environment but for some reason,
and I can access the application on local host just fine with full functionality.
However I have to remove ALL my configs from the vercel.json file and use just {} as it’s content for vercel dev to run fine locally, but of course when I use vercel --prod, the deployment succeeds but
I get
‘404: NOT_FOUND
Code: NOT_FOUND
ID: iad1::g89m9-1725064247258-b9dc58c77523’

After a two days trying to cover all possibilities (read below), I consistently get
Vercel CLI 37.1.1
? Set up and develop “D:\OASMvrcl”? yes
? Which scope should contain your project? RameshRamloll’s projects
? Link to existing project? yes
? What’s the name of your existing project? oas-mvrcl
:link: Linked to rameshramlolls-projects/oas-mvrcl (created .vercel)
Error: The pattern “pages/api/openai-proxy.js” defined in functions doesn’t match any Serverless Functions inside the api directory.
What I’ve Tried

I have thoroughly reviewed the file paths and ensured that they are consistent and correct. Specifically, I verified that the file openai-proxy.js is located in pages/api/ and that it is referenced correctly in the vercel.json file. Despite this, the error persists.

Here’s a summary of the troubleshooting steps I’ve already taken, multiple times, without success:

  1. Cleared Vercel cache: Both locally (by removing the .vercel folder) and in the Vercel dashboard.
  2. Reinstalled all dependencies: Deleted node_modules and package-lock.json, then reinstalled everything.
  3. Reviewed and retyped file paths: Ensured there are no invisible characters or case sensitivity issues.
  4. Linked to the existing project: Confirmed that the project is correctly linked during the setup process.

Request for Assistance

Despite these efforts, I continue to face the same error, and it has become a major blocker for my project development. I would be extremely grateful if you could provide any insights or solutions to resolve this issue.

I’m also open to providing any additional details or logs if needed. Thank you in advance for your support.

Hi @rezmela-admin. This error usually means that the pattern defined in the vercel.json file doesn’t match any Serverless Functions. But you mentioned you already checked the file path.

You also mentioned a 404 error, but I’m not sure if that’s happening for the function or on the site’s homepage. Does the openai-proxy serverless function deploy correctly without the functions configuration?

If you can share a minimal reproducible example, that will let the rest of us see the same thing you do. Then we can debug it together. :slightly_smiling_face:

The problem was that Frame was set to other, instead of Node.js.
May be that’s the first thing users need to check before checking the pattern matching issue.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.