From d585e31c7f5ae78e89bd9d75c7716bf1457d563f Mon Sep 17 00:00:00 2001 From: FuturMix Date: Sun, 14 Jun 2026 09:38:10 +0800 Subject: [PATCH] fix: use response.json() instead of response.NextResponse.json() in Telnyx webhook The sendTelnyxResponse function incorrectly calls response.NextResponse.json() which throws a TypeError at runtime since NextResponse is not a property of the fetch Response object. This prevents error details from being logged when the Telnyx API returns an error response. --- src/app/api/webhooks/telnyx/sms/route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/webhooks/telnyx/sms/route.js b/src/app/api/webhooks/telnyx/sms/route.js index e223c2c..7030113 100644 --- a/src/app/api/webhooks/telnyx/sms/route.js +++ b/src/app/api/webhooks/telnyx/sms/route.js @@ -218,7 +218,7 @@ async function sendTelnyxResponse(fromPhone, toPhone, message) { }); if (!response.ok) { - const errorData = await response.NextResponse.json(); + const errorData = await response.json(); console.error('[TELNYX-WEBHOOK] Failed to send response SMS:', errorData); } else { console.log('[TELNYX-WEBHOOK] Response SMS sent successfully');