Error Opening HTML File with Bundled JS and CSS in Android

EDIT:
This issue is a duplicate of the one already discussed here: #428

Original Text:
HTML file with CSS and JavaScript bundled using Parcel or WebPack does not display in WebView. The bundled file displays fine when opened directly in a desktop browser. Additionally, the WebView is able to successfully open a regular web page.

The HTML file is imported into the component containing the WebView using the following code
const index = require('./dist/index.html');

This can be reproduced by creating an Expo project with a WebView in it. Building an HTML file with CSS and JS bundled into it, and then importing that file for use into the WebView.
The Github repo at https://github.com/reggie3/react-native-webview-bundle-demo has a project demonstrates this technique and also reproduces this issue.

The expected behavior is that the HTML file is rendered correctly. The bundling technique has worked successfully in the past. I have used it successfully in the react-native-webview-leaflet project.

I a

Environment:

Edit:
I updated the repo to follow the style of react-native-webview-leaflet more closely and now the webview shows the text of the bundled file.
Screenshot_20190623-123533

1 thought on “Error Opening HTML File with Bundled JS and CSS in Android

  1. Pingback: lace front wigs

Comments are closed.