Creating an instance of URL like: `new URL('http://facebook.com')` throws an exception.
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.6.0 Yarn: 0.24.6 npm: 5.3.0 Watchman: 4.7.0 Xcode: Xcode 8.3 Build version 8E162 Android Studio: 2.3 AI-162.3934792
Packages: (wanted => installed) react: 16.0.0-alpha.12 => 16.0.0-alpha.12 react-native: ^0.48.4 => 0.48.4 Target Platform: iOS (10.3)
Steps to Reproduce
- Create a ReactNative project, which uses React Native 16
- Try to create an instance of
URL
in any .js file, like this:const url = new URL('http://facebook.com');
- Run the project
Expected Behavior
The URL to be the native URL, this one. It was working fine in React 15, but in React 16 it was replaced with something internal. We use URL to parse URLs and extract information about the hostname, port, etc. so we need this behaviour back.
Actual Behavior
An exception is thrown: Creating BlobURL objects is not supported yet.

Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:44
- Comments:39 (5 by maintainers)
Top Results From Across the Web
Is there an utility to parse an URL without checked exception ...
You can construct it using either of the following ways: new URI() , which throws a checked exception; URI.create() , which throws an...
Read more >react-native-url-polyfill - npm
A lightweight and trustworthy URL polyfill for React Native. Latest ... Creating an instance of URL like: new URL('http://facebook.com') throws an exception ......
Read more >Handle Errors - Graph API - Meta for Developers
The Handle Errors for Graph API Requests guide describes the errors and possible reasoning for requests that receive an error.
Read more >Source code - javadoc.io
</li> 067 * <li>Delete an object: use {@link #deleteObject(String, Parameter. ... 103 * @throws FacebookException 104 * If an error occurs while performing ......
Read more >Facebook error: “Can't load URL: The domain of this URL isn't ...
If you don't have a Sharetribe website, these instructions won't apply, and you should contact your own service provider. When you set up...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hramos if a polyfill existing is reason enough to close this issue then I think the React Native team should deprecate the URL module and outsource it to the community as they have with others. This weird, multi-year, limbo state of the URL module is not good…
This can be worked around. Add this little piece of nastiness to your
index.js
: