Skip to content

On built website, JS execution in IE10 within React components is unreliable #2807

@pkiddie

Description

@pkiddie

Steps to reproduce:

  1. 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.
  2. Run gatsby build && gatsby serve.
  3. Open http://localhost:9000/page-2/ in a modern Chrome browser. Note executing JS always dumped to console.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions