After a production of shiny apps on ShinyProxy, I have received reports from users that those apps do not open in Internet Explorer 11 (mostly) and 10 (less often) by remaining on white screen after choosing apps. While investigating the issue, I suspect the error was related to JQuery call.
Situation/Condition:
When a new instance is to be created (no previous instances) by IE 11 (or 10), the shiny app fails to load.
(Another approach to replicate the issue, rerun the ShinyProxy.)
Once the app is successfully loaded with Chrome, Firefox, or other modern browsers, IE can successfully access the app. There was no such (IE-related) error when alternatives were used.(Shiny Server, ShinyApps.io, etc.)
Error Message:
SCRIPT5007: Unable to get property ‘style’ of undefined or null reference
ShinyProxy Code
<script type="text/javascript">
function setShinyframeHeight() {
$('#shinyframe').css('height', ($(window).height())+'px');
}
window.addEventListener("load", setShinyframeHeight);
window.addEventListener("resize", setShinyframeHeight);
$(window).on('load', function() {
var source = $("#shinyframe").attr("src");
if (source == "") {
$(".loading").show(); // **here is where error occurs**
…
Specifically, this error is raised when the following code was accessed:
(jquery/src/css/support.js)
JQuery Code (support.js)
// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
// Some styles come back with percentage values, even though they shouldn't
div.style.right = "60%"; // ** this is the line causing the error.**
From the following link, someone pointed out that the error occurs when IE does not handle a CSS feature detection code above. Compatibility Mode does not solve it with any options (checked/unchecked).
Link (FYI):
https://github.com/jquery/jquery/issues/3273
Comment
Strangely, the app is loaded after couple (at least two) of Refresh (F5)* or anyhow an instance was previously created by other browsers. Also, based on finding that the same app works on shinyapps.io or shiny server, it may seem that it is related to how ShinyProxy handles such type of errors in IE. I am wondering if you can make a fix to handle JQuery erros on IE.
Again, I hope if there is a quick fix. (It is bit hard to persuade IE users to hit F5.) Thanks a bunch!