IE9 and IE10 error

I have created a simple html page and serving it via node package serve.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>DANS</title>
  <script src="https://cdn.ravenjs.com/3.21.0/raven.min.js" crossorigin="anonymous"></script>
  <script>Raven.config('https://*****@sentry.io/****').install()</script>
  <script>
    throw 'DANS error';
  </script>
</head>
<body>
  DANS
</body>
</html>

It works fine in all the modern browsers, but in IE10 and IE9 I get error:

'Raven' is undefined

(when trying to set the config).

So Ravens not on the window object at all for some reason?

Any help would be great thanks :slight_smile:

Dan

Ok, so this line was the problem, if I change it to a protocol-relative URL the issue goes away:

<script src="//cdn.ravenjs.com/3.21.0/raven.min.js" crossorigin="anonymous"></script>

Im guessing this is because I’m testing on un-secure localhost, and it doesnt like the fact I’m getting secure content from an un-secure site. Current best practise* suggests to always use the https protocol, so I guess I’ll just put up with the error in local dev env for older IEs, (as obviously the live site is served over https anyway).

*https://github.com/konklone/cdns-to-https#conclusion-cdns-should-redirect-to-https