WebView errorCode: 101 on some sites, after initially loading successfully
On some urls I get a weird 101 error after successfully loading the page (which replaces the loaded page with the error page).
URLs that work, e.g.: http://www.redbull.com URLs that don't work, e.g.: http://www.cnn.com
domain: "WebKitErrorDomain"
errorCode: 101
Description: The URL can't be shown
The code I use is this:
<WebView
source={{ uri: url}}
scalesPageToFit={true}
startInLoadingState={true}
renderError={this._renderError.bind(this)}
renderLoading={this._renderProgress.bind(this)}
onLoad={this.onLoad.bind(this)}
style={localStyle.browserModal}
/>
The WebView is shown in a Modal.
I do use a setState in onLoad function, triggering a re-render.
What version of React Native are you using ?
This occurs on Android, iOS or both?
I'm seeing the same error, shown inside the Webview:
Error loading page
domain: "WebKitErrorDomain"
errorCode: 101
Description: The URL can't be shown
Along with 36 repeated yellowbox warnings.
On RN 0.25.1, loading http://www.bloomberg.com/quote/SUNEQ:US in WebView.
As an aside, I reckon this is related to UIWebView being dated. Apple likely only support and update WKWebView at this point, not fixing bugs with the prior. Related: #321
RN Webview really need modernizing to use WKWebView instead. For every reason of performance, security and support.
👍 same here. Using RN 0.34
There should be better handling of redirects to unknown URL handlers. Like stop loading such and log with the error On Wed, Oct 19, 2016 at 3:26 AM Adriano Tadao [email protected] wrote:
I have a similar error, but I'm receiving the error 102. =l
I'm trying to open a URL that will redirect me to a customDomain://... 😢
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/7839#issuecomment-254612029, or mute the thread https://github.com/notifications/unsubscribe-auth/ADoJSl7_60OJOwV8zANtVOFDkYuU2aEUks5q1R01gaJpZM4IqDVH .
Ok I am going to reopen this and remove the comments about error 102 to make it clear that error 102 is being discussed in https://github.com/facebook/react-native/issues/9037 not in this issue.
@lacker Error 101 is being discussed in #9037 as well not Error 102
Ah, you are right. So the remaining comments here are actually a dupe of https://github.com/facebook/react-native/issues/9037 after all. OK, I think unfortunately I have mauled this issue into confusion because I mishandled the whole multiple-issues-reporting-some-overlapping-subset-of-distinct-problems thing. I'm going to re-close it, partly out of despair, partly because the remaining information is duplicated anyway. If there is something we are missing with the current set of open issues, perhaps it would be best to open a new issue and be very precise in the title about which bug it is reporting.
I don't see a mention to the 101 code error in #9037, also the workaround mentioned there does not solve this issue for me, it only hides the error message but the webview turns blank when it happens.
I'm testing in react-native 0.36.1.
@messuti-edd The reference to a 101 error is in the xcode screen shot.
Thanks @lacker I will comment there then.