Steps to reproduce:
- Clone https://github.com/pkiddie/gatsby-ie10-js-no-execute. This is
gatsby-starter-default with inline JS on the page-2.js React component to dump executing js to the console.
- Run
gatsby build && gatsby serve.
- Open
http://localhost:9000/page-2/ in a modern Chrome browser. Note executing JS always dumped to console.
- Open
http://localhost:9000/page-2/ in IE10 (via modern.ie @ https://developer.microsoft.com/en-us/microsoft-edge/tools/vms or Browserstack), note that executing JS is not always dumped to console.
I have a fix which is to detect IE10 via window.navigator and then write out the script tags with defer in the async script loader (in packages/gatsby/cache-dir/static-entry.js, whose script is pulled from https://www.html5rocks.com/en/tutorials/speed/script-loading/). Happy to raise a PR for this.