Fix: use glob pattern in vercel.json functions key#4
Merged
Conversation
Vercel CLI 51+ requires a glob pattern in the `functions` key, not an exact file path. "api/index.py" was rejected with "doesn't match any Serverless Functions"; "api/**/*.py" is the documented correct form. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Both exact-path and glob patterns in the `functions` key fail with "doesn't match any Serverless Functions" — meaning Vercel's auto- detection isn't finding the Python function before the validation runs. Dropping the `functions` key entirely lets Vercel auto-detect api/index.py as a Python serverless function without the validation step blocking the build. The excludeFiles optimisation can be re-added once the base deployment is confirmed working. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Vercel scans the `app/` directory for recognised Python entrypoint filenames (main.py, app.py, server.py, index.py, wsgi.py, asgi.py) and treats any match as a serverless function. `app/main.py` was being detected and imported directly — without the project dependencies installed — causing FUNCTION_INVOCATION_FAILED on every request. Renaming to `application.py` (not in Vercel's detection list) makes `api/index.py` the sole entry point as intended. Updated: api/index.py, tests/conftest.py, CLAUDE.md, README.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
httpx was only in [dev] extras, so Vercel (which runs pip install . not pip install .[dev]) did not install it. httpx is used in production code (app/services/foys.py) so it belongs in the main dependency list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All dependencies are now declared in pyproject.toml. Vercel reads pyproject.toml directly (pip install .), so requirements.txt was redundant and could cause confusion about which file is authoritative. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the production deploy failure:
Vercel CLI 51+ validates that the
functionskey contains a glob pattern (not a literal path). Changed"api/index.py"→"api/**/*.py", which is the documented correct form per the Vercel Python runtime docs.One-line diff in
vercel.json.