#api routes not working in production
1 messages · Page 1 of 1 (latest)
Based on the provided extracts, I cannot pinpoint the exact issue with your serverless function. However, I can provide some general troubleshooting steps to help you identify the problem.
- Check the application logs: You can find the application logs at the host URL under the
/_logspath. For example:
https://my-deployment-my-username.vercel.app/_logs
Source: Vercel Application Error Codes (https://vercel.com/docs/errors/application-error-codes)
-
Ensure your dependencies are installed correctly and compatible with your Next.js version.
-
Make sure your serverless function is not reaching the timeout threshold (https://vercel.com/docs/concepts/limits/overview#serverless-function-execution-timeout) in production.
-
Customize the 500 page (https://nextjs.org/docs/pages/building-your-application/routing/custom-error#500-page) to provide a better user experience when an unhandled exception occurs.
-
Consider using an error tracking tool like Sentry to log and track exceptions. There's a Sentry integration for Vercel (https://vercel.com/integrations/sentry?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) and a Next.js example with Sentry (https://github.com/vercel/next.js/tree/canary/examples/with-sentry).
Source: Next.js Production Checklist (https://nextjs.org/docs/pages/building-your-application/deploying/production-checklist)
If you still face issues, I recommend checking the official Next.js and Vercel documentation for more information.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
This section focuses on errors that can happen at the level of your application when you interact with Vercel.
This reference covers a list of all the limits and limitations that apply on Vercel.
@indigo hemlock kapa.ai is still learning and improving, please let us how it did by reacting below