1

We started introducing React to our large Django project to handle frontend complexity. So far, so good, but we ran into a problem.

React does not work in production on IE8. Locally it works fine on IE8. I've included es5-shim and es5-sham and I do see them in dev tools in production (included in the header, before React and code that's using React). But still, I get this error, like there's no shim:

SCRIPT438: Object doesn't support property or method 'isArray' 

I also got:

SCRIPT438: Object doesn't support property or method 'bind'

after which I included script mentioned in this post:

How to handle lack of JavaScript Object.bind() method in IE 8

However, after that I get:

SCRIPT5023: Function does not have a valid prototype object 

And I'm still getting the old errors. Again, locally it's working fine in IE8 so I'm guessing it's not the code itself that is the problem. Our app uses AWS CloudFront (but I do see the static .js files included in the html).

Any ideas what might be happening here?

Community
  • 1
  • 1
dnmh
  • 2,045
  • 2
  • 34
  • 49
  • Could you elaborate on the difference between your production and local builds? The culprit is likely caused by one of those differences. – Ed Ballot Jul 31 '15 at 15:19
  • I mean these errors only occur in ie8 if the es5-shim/sham isn't loaded properly - this can be the only issue. – Mike Driver Jul 31 '15 at 18:38
  • @EdBallot - no difference because we build jsx to js locally and that goes up. Not sure if that's the best option though, but that's another topic. – dnmh Jul 31 '15 at 19:06
  • @MikeDriver - I think you are right. I tried opening the shim file directly from IE8 and there was a problem with it. So, it seems it gets either corrupted when in production or something similar. – dnmh Jul 31 '15 at 19:08
  • Oddly enough, it started working on Monday, probably due to a caching issue... – dnmh Aug 04 '15 at 12:48

0 Answers0