SyntaxError: missing] after list of items

I have a mapbox-gl.js map with markers in the vue component. At the end of mapdrag, the list is made of all the markers in the viewport (using setTimeout to avoid performance issues with many markers). Everything works as expected, but I get an error at the end of drag / moveend:

Uncaught SyntaxError: Unexpected identifier

No additional data ..., the error applies, for example. to VM9336, which contains:

[object HTMLDivElement],[object HTMLDivElement],[object HTMLDivElement],[object HTMLDivElement]

The number [object HTMLDivElement] corresponds to the number of markers in the viewport.

It seems that from this mapbox-gl.js function, an error appears:

Actor.prototype.receive = function(t) {
                var e, a = this, r = t.data, s = r.id;
                if (!r.targetMapId || this.mapId === r.targetMapId) {
                    var i = function(t, e, r) {
                        a.target.postMessage({
                            sourceMapId: a.mapId,
                            type: "<response>",
                            id: String(s),
                            error: t ? String(t) : null,
                            data: e
                        }, r)
                    };
                    if ("<response>" === r.type)
                        e = this.callbacks[r.id],
                        delete this.callbacks[r.id],
                        e && e(r.error || null, r.data);
                    else if ("undefined" != typeof r.id && this.parent[r.type])
                        this.parent[r.type](r.sourceMapId, r.data, i);
                    else if ("undefined" != typeof r.id && this.parent.getWorkerSource) {
                        var p = r.type.split(".")
                          , d = this.parent.getWorkerSource(r.sourceMapId, p[0]);
                        d[p[1]](r.data, i)
                    } else
                        this.parent[r.type](r.data)
                }
            }

How much I lost ... any idea?

EDIT: in Firefox (instead of Chrome) I get the following errormessage:

SyntaxError: missing ] after element list  0.821efde866de69447c4f.js%20line%20491%20%3E%20eval:119:8

but when I click on the link to the Firefox code, Firefox seems to be unable to read the code ...

0

Source: https://habr.com/ru/post/1609900/


All Articles