React-mapbox-gl: Uncaught ReferenceError: e is not defined

Created on 24 Apr 2017  路  8Comments  路  Source: alex3165/react-mapbox-gl

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

Most helpful comment

@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.

All 8 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PawkaHub picture PawkaHub  路  17Comments

kaligrafy picture kaligrafy  路  19Comments

stereobooster picture stereobooster  路  31Comments

evanfrawley picture evanfrawley  路  26Comments

aziz-boudi4 picture aziz-boudi4  路  14Comments