Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Admin Route Serverless Function Timed Out ( In production only )

default discord avatar
kenny3971last year
2

Hello. I migrated an existing project and added payload to it. When in dev, everything works like a charm. I can access the /admin route, login and do everything payload is supposed to. However, once deployed on vercel, when I try to hit the route /admin, I get an error: This Serverless Function has timed out. Did this happen to anyone else? If so, what was the fix for that? Thank you!

  • default discord avatar
    tipsytuxlast year

    Hi! I guess it could be an issue with the environment variable in Vercel. If you have not defined the MongoDB URL or any other database connection you might be using. You may need to redeploy if you added the env variable after deploying the website.

  • default discord avatar
    kenny3971last year

    Thank you for your answer. I validated that my .env variable is present in vercel env variable. Do you have any idea what else could cause this? Tyvm!



    Found the issue. I used the database mongodb and in the mongodb atlas I did not set the "Allow Access From Everywhere". So when I was hitting the admin route, payload tried to access my db but could not.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.