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

Minifying fails with mapbox-gl #2520

Closed
sheerun opened this issue Nov 27, 2017 · 7 comments
Closed

Minifying fails with mapbox-gl #2520

sheerun opened this issue Nov 27, 2017 · 7 comments

Comments

@sheerun
Copy link

sheerun commented Nov 27, 2017

Bug report or feature request?

Bug report

ES5 or ES6+ input?

ES5

Uglify version (uglifyjs -V)

2.8.29
EDIT: 3.2.0 as well

JavaScript input

require('mapbox-gl')

and bundle with something like webpack

The uglifyjs CLI command executed or minify() options used.

I used one built with next.js

JavaScript output or error produced.

Uncaught ReferenceError: e is not defined

More details:

mapbox/mapbox-gl-js#4359

Mapbox closed their issue and said it needs to be fixed upstream...

@sheerun sheerun changed the title Minifying fails with Minifying fails with mapbox-gl Nov 27, 2017
@alexlamsl
Copy link
Collaborator

Latest version of uglify-js is 3.2.0

@sheerun
Copy link
Author

sheerun commented Nov 27, 2017

let me try to update

@kzc
Copy link
Contributor

kzc commented Nov 27, 2017

We've been through this before. Not a bug in uglify.

#2011 (comment)
#2011 (comment)

"webworkify stringifies functions to send to the worker. This is risky"

facebook/create-react-app#2376 (comment)

I also outlined how global could be removed from mapbox-gl's dependencies entirely:

facebook/create-react-app#2376 (comment)

It's just an unused remnant of a browser port of built-in node libraries originally made for browserify. This is the root cause of the problem.

See also: webpack global settings:

angular/angular-cli#5804 (comment)
angular/angular-cli#5804 (comment)

@sheerun
Copy link
Author

sheerun commented Nov 27, 2017

@alexlamsl still happens with 3.2.0
@kzc I've notified mapbox-gl in mentioned issue it's their bug and linked your comment

Could we leave this issue open until either mapbox-gl or uglify or webpack resolves this? I hope @jfirebaugh and @mourner could agree to fix it somehow (even upstream), as this is real issue.

Disabling minification of mapbox-gl or disabling comparisons compression is not a real solution.

@sheerun
Copy link
Author

sheerun commented Nov 27, 2017

Also referencing webpack/webpack#4414 and @sokra

This might be relevant for you: mapbox/mapbox-gl-js#4359 (comment)

@alexlamsl
Copy link
Collaborator

@sheerun I'll have to close this since it is not an issue with uglify-js - this is simply an invalid use of JavaScript.

@agiratech-vigneshm
Copy link

Upgrading to mapbox-gl.js 0.48.0 fixes this error if anyone still experiences this. I got it suddenly after moving to angular 6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants