TypeError: url.URL is not a constructor
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
Solution: TypeError: url.URL is not a constructor
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
Trust Score
3 verifications
- 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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep