The package works perfectly in a local dev environment but when I deploy to Heroku, I get the following error:
Uncaught ReferenceError: e is not defined
Here is the full stack trace:
33../support/isBuffer @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:2
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
104.util @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:5
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
131.../error/validation_error @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:6
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
145../reference/latest @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:6
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
159.../style-spec/validate_style.min @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:7
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
151.../style-spec/reference/latest @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:6
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
157.../style-spec/feature_filter @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:6
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
100.../style/style_layer_index @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:4
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
anonymous @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:10
i @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
e @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
(anonymous) @ blob:https://app.herokuapp.com/ff936ac0-6d3f-4861-be69-5014291c6119:1
It was an issue with v2.0.0 of standard-minifier-js and probably UglifyJS2. Downgrading to v1.2.3 solves this issue for now.
Can you be more specific on how have you resolved this issue
@mario-jerkovic I am using this library in a Meteor app. I downgraded my standard-minifier-js meteor package to v1.2.3 to resolve the issue.
@cshah3 Thanks.. I am having the same issue with React app, but cannot get around it
@mario-jerkovic Did you find a solution? Thanks!
@andrea689
After a lot of debugging I have figure out that UglifyJsPlugin was causing this error to occur, so I have removed new webpack.optimize.AggressiveMergingPlugin() and set UglifyJsPlugin like this:
new webpack.optimize.UglifyJsPlugin({ compress: false })
Hi @mario-jerkovic I'm still getting this issue did you make any more changes to your webpack build? Also mind sharing your versions of react-mapbox-gl and webpack?
Thanks
@taystu It an known issue with mapbox-gl and Uglify.
You have a detailed explanation of the issue here: https://github.com/mapbox/mapbox-gl-js/issues/4359#issuecomment-303880888
And here: https://github.com/mishoo/UglifyJS2/issues/2520#issuecomment-347342508
And a correct way to solve it: https://github.com/angular/angular-cli/pull/7931#issuecomment-348032708
To sum it up, just set typeofs : false to Uglify options.
Most helpful comment
@taystu It an known issue with
mapbox-glandUglify.You have a detailed explanation of the issue here: https://github.com/mapbox/mapbox-gl-js/issues/4359#issuecomment-303880888
And here: https://github.com/mishoo/UglifyJS2/issues/2520#issuecomment-347342508
And a correct way to solve it: https://github.com/angular/angular-cli/pull/7931#issuecomment-348032708
To sum it up, just set
typeofs : falsetoUglifyoptions.