Getting white screen when trying to load JS file On android devices
See original GitHub issueHello and thank you for taking the time to report a bug. This is a community repository, meaning that it’s everyone’s responsibility to address bugs and send pull requests. Maintainers will be here to help/guide you if you have questions. Please search in the opened issues before submitting a new one. Issues with no activity for a long time will be closed.
Bug description: when trying to load intercom JS api, i got always a white screen.
To Reproduce:
const template = email =>
`
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
var APP_ID = 'XXXXXX';
window.intercomSettings = {
app_id: 'XXXXXX',
};
(function() {
var w = window;
var ic = w.Intercom;
if (typeof ic === 'function') {
ic('reattach_activator');
ic('update', w.intercomSettings);
} else {
var d = document;
var i = function() {
i.c(arguments);
};
i.q = [];
i.c = function(args) {
i.q.push(args);
};
w.Intercom = i;
var l = function() {
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://widget.intercom.io/widget/' + 'qpap2gle';
var x = d.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
};
if (document.readyState === 'complete') {
l();
} else if (w.attachEvent) {
w.attachEvent('onload', l);
window.onload = l;
} else {
w.addEventListener('load', l, false);
}
}
})();
window.Intercom('show');
window.Intercom('boot', {
app_id: 'XXXXXX',
});
</script>
</head>
<body></body>
</html>
`;
const IntercomWebview = ({ navigation }) => {
return (
<WebView
source={{ html: template() }}
startInLoadingState
useWebKit={true}
style={{
backgroundColor: 'green',
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
}}
onError={e => console.log('e', e)}
/>
);
};
Expected behavior: It should load intercom messanger
Environment:
- react-native version: 0.59.8,
- react-native-webview version:5.8.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Getting white screen when trying to load JS file On android ...
Getting white screen when trying to load JS file On android devices #763 ... it only appears on android devices, on IOS it...
Read more >White screen after load page in cordova android app
When index.html (main page) page is loaded, on Android 5.1 (real phone) only shows a white screen. When I minimize app by the...
Read more >How to fix the Whitescreen After a Static Deployment with ...
A very common thing you might see there in a “white-screen-situation”, is that your app failed to load the JavaScript bundle – and...
Read more >Where are my uploaded files and why webviewer shows white ...
I need to load some javascript uploaded and a .png image but can't find the path. I made it work uploadind the files...
Read more >Fix "Aw, Snap!" page crashes and other page loading errors
On your Android phone or tablet, open the Chrome app Chrome . · Tap More More and then New Incognito tab. · In...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem and this is the error I managed to log:
Failed to read the 'cookie' property from 'Document': Access is denied for this document
I was then able to fix it adding this code before initialising intercom:
Credit to: https://stackoverflow.com/a/53725491/1753600
I encountered the same situation Environment: expo: 33 react-native version: 0.59.8, react-native-webview version:5.8.2