Error when generating map is IE11

I have been using the evaluation version of GOJS for the last few months. I can successfully create diagrams in Chrome, Firefox, Safari and Microsoft Edge, but not in IE11.

I found two errors in IE11 con the console window.

1.) ‘init’ is undefined
2.) Syntax error

In the initialization I do the following:

<script src="https://unpkg.com/gojs/release/go.js"></script>
<script src="/js/GenerateMap.js"></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        init();
    });
</script>

Inside GenerateMap.js I have the following:

function init() {
var newString = document.getElementById(“valueFromServer”).value;
var GO = go.GraphObject.make;
…}

And for the Syntax error it tells me that it’s at line 13:

myDiagram.nodeTemplateMap.add("",
    GO(go.Node, "Auto",
        // the entire node will have a light-blue background
        { resizable: false, width: 130, height: 80, background: "transparent" },
        { click: function (e, node) { var data = node.data; clicknode(data.key);} },
        GO(go.Shape, "RoundedRectangle", { fill: "white" },
            new go.Binding("fill", "isSelected", function (sel) {
                if (sel) return "lightgoldenrodyellow"; else return "white";
            }).ofObject("").makeTwoWay()),
        GO(go.TextBlock, "Default Text",
            { stroke: "grey", font: "11px sans-serif", maxLines: 4, overflow: go.TextBlock.OverflowEllipsis },
            new go.Binding("text", "name"),
        ),
        new go.Binding("location", "loc", go.Point.parse)
    ));

Why would these issues only be with IE11?

IE11 and some other non-updating older browsers support GoJS diagrams but do not have support for some more modern JavaScript syntax. You cannot use let or const. You cannot use arrow functions (=>) or template literals (backquoted string expressions with ```).

I don’t see anything wrong with the code that you quoted, so the problem must be elsewhere. My guess is that this problem is what is causing init not to be defined.

EDIT: the problem is that there is a superfluous comma “,” after the Binding of “text”.