Skip to content

fix: use response.json() instead of response.NextResponse.json() in Telnyx webhook#92

Closed
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/telnyx-response-json-typo
Closed

fix: use response.json() instead of response.NextResponse.json() in Telnyx webhook#92
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/telnyx-response-json-typo

Conversation

@FuturMix

Copy link
Copy Markdown

Bug

In src/app/api/webhooks/telnyx/sms/route.js, the sendTelnyxResponse function calls response.NextResponse.json() on line 221 when handling Telnyx API errors. NextResponse is not a property of the fetch Response object — this throws a TypeError at runtime, preventing error details from being logged.

Fix

Changed response.NextResponse.json()response.json().

Impact

Without this fix, any Telnyx API error during SMS response sends causes an unhandled exception in the error logging path, masking the actual API error.

…elnyx 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants