Skip to content

webView Encountered an error loading page canGoForward: false, code: -1, canGoBack: false, description: "net::ERR_ACCESS_DENIED", loading: false, …} #21104

@mohamed-sultan

Description

@mohamed-sultan

Environment

React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: x64 Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz
Memory: 122.76 MB / 5.62 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.10.0 - /usr/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 3.5.2 - /usr/bin/npm
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.1 => 0.56.1
npmGlobalPackages:
react-native-cli: 2.0.1

dependencies:
axios": "^0.18.0",
"react": "16.4.1",
"react-native": "0.56.1",
"react-native-file-viewer": "^1.0.5",
"react-native-fs": "^2.11.15",
"react-native-image-placeholder": "^1.0.14",
"react-native-vector-icons": "^5.0.0",
"react-native-zip-archive": "^2.2.6",
"rn-fetch-blob": "^0.10.13"
}

Description

failed to load internal html file from android emulator In WebView

Reproducible Demo

here is my source code
<WebView

          style={{width:'100%',height:'100%'}}
          source={{ uri: `file://${RNFS.DocumentDirectoryPath}/fake/Elements/index.html`}}
/>

Activity

react-native-bot

react-native-bot commented on Sep 13, 2018

@react-native-bot
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

react-native-bot

react-native-bot commented on Sep 13, 2018

@react-native-bot
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

maxammann

maxammann commented on Sep 17, 2018

@maxammann

I'm experiencing a similar problem when trying to show an image:

                  <WebView
                    source={{
                      baseUrl: RNFetchblob.fs.dirs.DocumentDir,
                      // html: '<html><body><a href="file:///data/user/0/com.app/files/red.png">asdf</a></body></html>'
                    }}
                    allowFileAccess={true}
                    scalesPageToFit={true}
                    originWhitelist={['*']}
                  />

I'm using version 0.57.0.

It works on ios.

maxammann

maxammann commented on Sep 17, 2018

@maxammann
maxammann

maxammann commented on Sep 17, 2018

@maxammann

I got it working with react-native-webview. Will look into it why it works only with this.

maxammann

maxammann commented on Sep 17, 2018

@maxammann

The reason is that this commit is missing in react native 0.57.0.

Titozzz

Titozzz commented on Sep 26, 2018

@Titozzz
Collaborator

Closing here. If the issue is still present on the new repository please open an issue there as @maxammann said ❤️

zhllucky

zhllucky commented on Nov 15, 2018

@zhllucky

@react-native-bot I have the same question in 0.57.3

mnoandh

mnoandh commented on Dec 6, 2018

@mnoandh

it happened to me also in android only when I use WebView from react-native .. but when I use WebView from react-native-webview I get another error for both ios and android ! is there any solution!

OS: Windows 7
Node: 8.11.1
Yarn: 1.9.4
npm: 6.2.0
"dependencies": {
"axios": "^0.16.2",
"expo": "^25.0.0",
"html-entities": "^1.2.1",
"moment": "^2.18.1",
"native-base": "^2.8.1",
"prop-types": "^15.6.0",
"react": "16.2.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
"react-native-htmlview": "^0.13.0",
"react-native-render-html": "^3.10.0",
"react-native-video": "^3.2.1",
"react-native-webview": "^2.14.0",
"react-navigation": "^1.0.0-beta.27",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-persist": "^4.8.2",
"redux-thunk": "^2.2.0",
"sanitize-html": "1.15.0"
},

1079339668
1419591602

maxammann

maxammann commented on Dec 6, 2018

@maxammann

@mnoandh Please open an issue in the react-native-webview github repo. Also add a code example.

locked as resolved and limited conversation to collaborators on Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hramos@maxammann@Titozzz@mohamed-sultan@zhllucky

        Issue actions

          webView Encountered an error loading page canGoForward: false, code: -1, canGoBack: false, description: "net::ERR_ACCESS_DENIED", loading: false, …} · Issue #21104 · facebook/react-native