Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unminified mapbox-gl broken #9726

Closed
hlolli opened this issue May 26, 2020 · 3 comments
Closed

unminified mapbox-gl broken #9726

hlolli opened this issue May 26, 2020 · 3 comments
Assignees
Labels

Comments

@hlolli
Copy link

hlolli commented May 26, 2020

mapbox-gl-js version:

1.10.1

browser:

(fails on build-time)

Steps to Trigger Behavior

  1. npm install mapbox-gl

Link to Demonstration

I think some of the javascript bundlers are incorrectly configured.

On lines 8185-8198 in the file dist/mapbox-gl-unminified.js you should see

    for (var i$1 = 0, list$1 = groupedByOutput; i$1 < list$1.length; i$1 += 1) {
        var ref = list$1[i$1];
        var outputIndex = ref[0];
        var labels = ref[1];
        if (labels.length === 1) {
            serialized.push(coerceLabel(labels[0]));
        } else {
            serialized.push(labels.map(coerceLabel));
        }
        serialized.push(this.outputs[outputIndex$1].serialize());
    }
    serialized.push(this.otherwise.serialize());
    return serialized;

where the token outputIndex$1 is undeclared, this breaks builds with for example google closure compiler, not sure how this affects other compilers.

@mourner mourner self-assigned this May 27, 2020
@mourner mourner added needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else) bug 🐞 release blocker ⛔ and removed needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else) labels May 27, 2020
@mourner
Copy link
Member

mourner commented May 28, 2020

Confirmed. It's a bug in Buble: bublejs/buble#258
I wonder why we never saw this error in testing and on live maps — the affected code is Match expression serialize.

@mourner
Copy link
Member

mourner commented May 28, 2020

Looks like the offending code (introduced in #6469) is never used at runtime, that's why we never noticed the issue. It's only reproducible when you process the bundle with Google Closure.

@mourner
Copy link
Member

mourner commented Feb 9, 2021

No longer relevant in v2+ since we don't transpile the bundle now.

@mourner mourner closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants