Cannot create URL objects in Widget Code

Hi Figma,

I’m trying to create a URL object from a string to check if the string is a properly formatted URL. However my code fails as shown below.

After looking up the issue, it seems like this issue shouldn’t happen since URL is already included in NodeJS. But clearly it isn’t being found here.

What am I missing? Any help would be appreciated :slight_smile:

Cheers!

I also faced this issue. But thanks to core-js GitHub - zloirock/core-js: Standard Library polyfill I managed to overcome the issue.