react-native icon indicating copy to clipboard operation
react-native copied to clipboard

WebView errorCode: 101 on some sites, after initially loading successfully

Open mschipperheyn opened this issue 10 years ago • 11 comments

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.

mschipperheyn avatar May 30 '16 22:05 mschipperheyn

What version of React Native are you using ?

This occurs on Android, iOS or both?

charpeni avatar May 31 '16 18:05 charpeni

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

fungilation avatar Jun 06 '16 22:06 fungilation

RN Webview really need modernizing to use WKWebView instead. For every reason of performance, security and support.

fungilation avatar Aug 07 '16 01:08 fungilation

👍 same here. Using RN 0.34

donedgardo avatar Oct 15 '16 04:10 donedgardo

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 .

fungilation avatar Oct 18 '16 20:10 fungilation

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 avatar Nov 02 '16 21:11 lacker

@lacker Error 101 is being discussed in #9037 as well not Error 102

alexkasemir avatar Nov 02 '16 21:11 alexkasemir

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.

lacker avatar Nov 02 '16 21:11 lacker

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.

messutied avatar Nov 03 '16 23:11 messutied

@messuti-edd The reference to a 101 error is in the xcode screen shot.

lacker avatar Nov 04 '16 00:11 lacker

Thanks @lacker I will comment there then.

messutied avatar Nov 04 '16 00:11 messutied