grammyjs / examples

Examples to kickstart your journey with grammY.
https://grammy.dev/demo/examples
MIT License
118 stars 33 forks source link

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

Closed KhudaDad414 closed 6 months ago

KhudaDad414 commented 6 months ago

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:

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 commented 6 months ago

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

/cc @PonomareVlad