Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next-node webhook example fails in Vercel production environment #46

Closed
KhudaDad414 opened this issue Mar 17, 2024 · 1 comment · Fixed by #47
Closed

next-node webhook example fails in Vercel production environment #46

KhudaDad414 opened this issue Mar 17, 2024 · 1 comment · Fixed by #47

Comments

@KhudaDad414
Copy link

Description:

The webhook example provided at https://github.com/grammyjs/examples/tree/main/setups/next-node does not work correctly when deployed to Vercel. The following behaviour occurs:

  • Production Timeout: The webhook callback function appears to run indefinitely, eventually causing a timeout on Vercel's serverless functions.

The example functions as expected in a local development environment.

Solution:

The issue was resolved by:

  1. Moving the webhook route definition into the pages directory (to create an API route within Next.js).
  2. using the next-js adapter for webhookCallback.

Possible Cause:
The original setup might not be compatible with Vercel's serverless function execution model. or Next.js app directory API routes and the std/http adapter probably are not compatible.

@KnorpelSenf
Copy link
Member

Are you able to fix the example so that others can benefit?

/cc @PonomareVlad

@PonomareVlad PonomareVlad linked a pull request Mar 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants