February 08, 2019

StimulusJS Ajax Functionalities Don't Work in Internet Explorer 11

Gani / February 08, 2019

Well at least for processing the response.

While working on the comments feature for HURR. There was an issue, from client feedback, on the comments form that I cannot duplicate in Chrome so I tried it on Microsoft Edge and Internet Explorer.

IE


The issue was on the UI part and I was able to duplicate it in IE and successfully fixed it. 

Then I found another issue. This time involving the actual commenting process which does not seem to work in Internet Explorer 11. The feature works well on Edge.

Internet Explorer AJAX Issues
 
IE memes



The comment forms have AJAX functionalities which I implemented using StimulusJS. One of my references for this feature was a Medium blog post about StimulusJS and Rails' remote forms.

While testing this on IE, I noticed that the data is being sent and processed by the server successfully and that the problem is on the clients handling of the server response.

So I researched about this and found out that IE had some issues with `XMLHttpRequest` support and that it used to use its own technology to handle these types of requests, `ActiveX Object`. This issue was with IE7 and below browsers, and I am using IE11, so not sure if this is still relevant.

I am also not sure if this is what's causing the issue in my case but I feel it is close.

StimulusJS Not Serious on Supporting Internet Explorer

Who cares about IE, it is getting killed by Microsoft over Edge so maybe the team that is responsible for StimulusJS are not interested in fully supporting IE. This is just an opinion, as their is still a huge chance that it was my code that caused all this and that StimulusJS fully supports IE in reality.

Also, maybe this is just a pending issue since StimulusJS is new and still being developed.

Who Cares About Internet Explorer

I have read about this recently. Even with all the issues in IE it is still one of the most used browser today.

Use IE to download a different browser


Not just for going to Mozilla and Chrome's download page but according to this another article from Medium, about the most popular desktop browsers for 2018, it has much more users than Safari, when IE users are combined with Edge.

Back to the code and to the issue of the feature. I dropped the use of StimulusJS for the AJAX functionalities of the commenting forms, I still use it on other functionalities that does not have problems on IE, and reverted to Rails' very own UJS.

Tested the feature again in IE11 and its now working well.

P.S. The memes are not mine, CTTO.