Blog Home ยป Debugged: Internet Explorer 11 Crash on JSON.stringify

Debugged: Internet Explorer 11 Crash on JSON.stringify

By Todd H Gardner

Internet Explorer 11 crashes when JSON.stringify is called on an HTMLFormElement that contains duplicate named inputs. This is particularly concerning because radio inputs will certainly have duplicate names.

In these simplified recreation steps, we can reliably crash Internet Explorer 11 (11.103.10586) by passing a simple HTMLFormElement into JSON.stringify. This is impacting some TrackJS customers, and the Tracker JavaScript Agent itself, which calls JSON.stringify when attempting to serialize console arguments.

<!DOCTYPE html>
    <h1>IE11 Freezes on JSON.Stringify</h1>

    <form id="my-form">
      <input name="emailoptin"  />
      <input name="emailoptin"  />

    <button id="freeze-me" onclick="JSON.stringify(document.getElementById("my-form"))">Freeze Me</button>




We are considering alternatives to avoid this bug, but in the meantime you can avoid this issue by adding a custom serializer to your TrackJS configuration that does not use JSON.stringify. For example:

  token: "YOUR_TOKEN",
  serialize: function (item) {
    return ""+item;
Todd H Gardner
Todd H Gardner
CEO and Cofounder