TypeError: Cannot read property 'isFileUploadSupported' of null
Asked Answered
N

1

6

I am trying to render a HTML snippet in my React-Native app using react-native-webview , I also tried react-native-render-html, but in this CSS is not work that much.

This is my Error Stack

 ERROR  TypeError: Cannot read property 'isFileUploadSupported' of null, js engine: hermes 
at App (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:93600:36)
at RCTView
at View
at RCTView
at View
at AppContainer (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:85300:36)
at DBC(RootComponent) (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:89907:28)
 ERROR  Error: Requiring module "node_modules/react-native-webview/index.js", which threw an exception: TypeError: Cannot read property 'isFileUploadSupported' of null, js engine: hermes 
at App (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:93600:36)
at RCTView
at View
at RCTView
at View
at AppContainer (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:85300:36)
at DBC(RootComponent) (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.dbc&modulesOnly=false&runModule=true:89907:28)
 ERROR  TypeError: Cannot read property 'WebView' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in DBC(RootComponent), js engine: hermes

And This is my code

import {SafeAreaView, ScrollView, useWindowDimensions} from 'react-native';
import {WebView} from 'react-native-webview';
import {getTemplate} from './template';

export default class App extends Component {
  render() {
    const template = getTemplate();
    const source = {
      html: template,
    };
    return (
      <SafeAreaView>
        <ScrollView>
          <ScrollView horizontal={true}>
            <WebView
              ref={r => (this.webref = r)}
              originWhitelist={['*']}
              source={source}
            />
          </ScrollView>
        </ScrollView>
      </SafeAreaView>
    );
  }
}
Nugatory answered 6/12, 2022 at 10:51 Comment(0)
F
0

As stated here try to install again react-native-webview

yarn:

yarn add react-native-webview

npm:

npm i react-native-webview
Ferric answered 20/4, 2023 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.