Fetch failed when call telegram api

The error occurs when calling the Telegram API during the app installation event. How to fix it?

I am testing on the prod because app install event is not triggering on the dev env.

TypeError: fetch failed
    at node:internal/deps/undici/undici:12618:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: getaddrinfo ENOTFOUND api.telegram.org
      at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
      at __node_internal_ (node:internal/errors:715:10)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3007,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'api.telegram.org'
  }
}

Manifest

  external:
    fetch:
      backend:
        - 'api.telegram.org'

Important note: fetch works for delete issue event on the dev env but throws the above error on the prod env

Hi @Alexandr , can you please use our version of the fetch client, unfortunately the global fetch that ships with Node 18+ doesn’t work at the moment. We are in the progress of polyfilling global fetch though, it should be ready in the nearby future.

2 Likes

Works. Thanks