Error using external library which is minified and makes no use of require

According to the docs and the countless other threads I've checked, I should be able to simply call the functions available in this library (libphonenumber-js) after adding the minified.js URL from CDNJS (which I've done).

All I get in my JavaScript snippets is a

parsePhoneNumber is not defined

I've even tried referencing the exported class PhoneNumber, but to no avail. I shouldn't have to make a custom component for this as per the docs, but I'm running out of options at this stage...

Found the answer. It was available as libphonenumber.parsePhoneNumber()

I was sure I had exhausted all of those options, but guess not

1 Like

Thank you so much for posting and circling back to share the solution here @BoscoDomingoSamara !

I see we do have it listed as the full npm package name google-libphonenumber in the docs. I'll look into whether we can make it more clear in that doc that in Retool folks should use syntax like libphonenumber.parsePhoneNumber().
Update: The name of the lib will default to importing as a specific name, but it's configurable. The team plans to update this Arcade demo to clarify that you should refer to the library using the name from the import, rather than document a particular default, since the exact values are subject to change

Regardless, I'm glad you shared here so folks looking into the same thing can learn from this post! :bowing_woman: