404 error on node.js project

I checked what to do avoid 404 error but still encountering it.
I have full access to the repository since it is my own. Added vercel.json and configure it as well.

Stuck at the point where I do not know how to solve the problem. Can anyone please help?
This might be one of the dumbest question so far, sorry. I am a newbie here)

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

What do you see when you check the deployment output?

If your project is all in serverless functions within the /api directory, then you might need to include that in the path or use rewrites

Hi.

I see my api folder, in which I have bot.js and weekly-summary.js and middleware

In https://telegram-content-creator-aol3cm0eu.vercel.app/api/bot.js, I see

This Serverless Function has crashed.

Your connection is working correctly.

Vercel is working correctly.

500: INTERNAL_SERVER_ERRORCode: FUNCTION_INVOCATION_FAILEDID: hkg1::tz66x-1745910507251-9e9d495c2527

{
“version”: 2,
“builds”: [
{
“src”: “api/bot.js”,
“use”: “@vercel/node”
},
{
“src”: “api/weekly-summary.js”,
“use”: “@vercel/node”
}
],
“routes”: [
{
“src”: “/api/bot”,
“dest”: “api/bot.js”
},
{
“src”: “/api/weekly-summary”,
“dest”: “api/weekly-summary.js”
},
{
“src”: “/”,
“dest”: “/api/bot”
}
]
}

This is how I modified vercel.json file.

It seems there’s an error in this code, right?

Alright, then it sounds like the project throws a 404 error after a function fails to return the expected resource. You can find more details about the 500 error by checking the runtime logs.

In this case, I see OpenAIError: The OPENAI_API_KEY environment variable is missing or empty. Please check that all necessary environment variables have been set for your project and redeploy. That should fix this 500 error

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