[Python serverless function returns 404 in local, but fine in prod - Help - Vercel Community]
The original question in the article above addressed this issue, but no satisfactory answer was provided, and it was not clear that it was recognized as a bug.
In my case I was running into issues testing using “vercel dev” and decided to make absolutely certain it wasn’t an issue on my end. I used this repo
examples/python/nextjs-flask/README.md at main · vercel/examples
Which is provided by the Vercel team as an example of how to use Python serverless functions with Vercel. By cloning the repo and using “npm run dev” as it suggests in the README.md it works fine, but using the “vercel dev” command works for spinning up the next.js app, but when clicking the link to the python serverless function “/api/python” it returns a 404. When deploying the same project in production it gives no 404 and works as intended. This makes the “vercel dev” command useless since the only point of using it over “npm run dev” would be to test if it is recognizing the python serverless functions correctly, but it breaks.
I’m unsure of a solution to this, and I am unsure of the purpose of “vercel dev”, so if this command is not intended to mimic the production environment and enable the testing of serverless functions using the Vercel deployment environment, further documentation would be appreciated to clarify the purpose.
If not, and this is indeed a bug, then hopefully this is clear enough for the team to understand the problem. Thanks.