grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.37k stars 117 forks source link

How to deploy to vercel? #647

Closed everyPassion closed 3 weeks ago

everyPassion commented 1 month ago

I followed the tutorial https://grammy.dev/zh/hosting/vercel, but why the robot cannot run. The log records on vercel feedback the following 2 information

[POST] /api/bot status=500

TypeError: req.json is not a function at stdHttp (/var/task/node_modules/grammy/out/convenience/frameworks.js:254:21) at /var/task/node_modules/grammy/out/convenience/webhook.js:23:79 at Server. (/opt/rust/nodejs.js:1:10660) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Server. (/opt/rust/nodejs.js:8:4429)

I'm very anxious. Can you help me?

everyPassion commented 1 month ago

i use CommonJS specification

KnorpelSenf commented 1 month ago

If you need help with a programming problem, you need to share the code you wrote.

Also, there are are several examples for vercel here: https://github.com/grammyjs/examples/tree/main/setups

everyPassion commented 3 weeks ago

If you need help with a programming problem, you need to share the code you wrote.

Also, there are are several examples for vercel here: https://github.com/grammyjs/examples/tree/main/setups

3q