Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio client does not resolve when using with bun

I have a verification check function 

    async verifyWithOTP(phone: string, otp: string) {
    console.log({ phone, otp });
    try {
      console.log("awaiting verification");
      const verification = await client.verify.v2
        .services("VA32f14036285fccdcc0a7ac76ac424515")
        .verificationChecks.create({
          to: phone,
          code: otp,
        });
      console.log(verification.status);
      console.log("verification successful");
      return true;
    } catch (error) {
      console.log("failed to verify:", error);
      return false;
    }
  }

This function is called in elysiajs which run in Bun runtime. But the promise never resolves, so the code just get stuck after printing "awaiting verification". As a result the function is of no use, but twilio dashboard shows approved for that request. So the client must be getting hanged. Is there any other solution or should I move to a node based backend framework?

like image 311
Tushar Avatar asked Mar 13 '26 09:03

Tushar


1 Answers

it seems like the issue is on bun's side. I suggest to keep an eye on bun's github repo for the updates.

  • Twilio client hangs
  • axios issue related to the same problem
like image 134
Iaroslav Sobolev Avatar answered Mar 15 '26 22:03

Iaroslav Sobolev