FG
๐Ÿ”Œ APIs & SDKsTwilio

TypeError: url.URL is not a constructor

Freshover 5 years ago
Mar 14, 20260 views
Confidence Score78%
78%

Problem

Issue Summary I am using latest version of this library 3.44.0. (I see from the npm version log. it's just a day ago!) and having the following error. TypeError: url.URL is not a constructor when I try to send message. the code is copied from doc. https://www.twilio.com/docs/sms/quickstart/node Steps to Reproduce 1. set up simple react project with create-react-app 2. npm install twilio 3. execute following code App.js Code Snippet [code block] Exception/Log [code block] Technical details: twilio-node version: 3.44.0 node version: 12.13.0

Error Output

Error: url.URL is not a constructor** when I try to send message. the code is copied from doc. https://www.twilio.com/docs/sms/quickstart/node

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
74% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: TypeError: url.URL is not a constructor

Low Risk

I think there are significant valid use cases wherein someone might want to run twillio-node on a react frontend. For example, in an electron app where the user is also the owner of the twillio account (or are from the same organisation). This is my use case. It seems that, apart from this URL class issue, nothing else would stop twillio to work on the frontend. Is there any workaround ? How could

74

Trust Score

3 verifications

100% success
  1. 1

    I think there are significant valid use cases wherein someone might want to run

    I think there are significant valid use cases wherein someone might want to run twillio-node on a react frontend. For example, in an electron app where the user is also the owner of the twillio account (or are from the same organisation). This is my use case. It seems that, apart from this URL class issue, nothing else would stop twillio to work on the frontend. Is there any workaround ? How could one get access to the URL class native to node, but in a browser?

Validation

Resolved in twilio/twilio-node GitHub issue #577. Community reactions: 4 upvotes.

Verification Summary

Worked: 3
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

twiliosmsapitype:-questionstatus:-waiting-for-feedback