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

Mapbox "Uncaught ReferenceError: e is not defined" #135

Closed
jvandenaardweg opened this issue Jul 26, 2018 · 2 comments
Closed

Mapbox "Uncaught ReferenceError: e is not defined" #135

jvandenaardweg opened this issue Jul 26, 2018 · 2 comments

Comments

@jvandenaardweg
Copy link

jvandenaardweg commented Jul 26, 2018

We got a Uncaught ReferenceError: e is not defined on a clients test environment that uses a React version of Mapbox GL. After digging in that error, there's a possible solution in the Uglify options in Webpack: alex3165/react-mapbox-gl#200 (comment)

typeofs: false is the fix

/build/lib/build.js

new UglifyJsPlugin({
  cache: true,
  parallel: true,
  sourceMap: true,
  uglifyOptions: {
    compress: {
      typeofs: false /* added so the build works with Mapbox: https://github.com/alex3165/react-mapbox-gl/issues/200#issuecomment-370175270 */
    }
  }
})

What typeofs: false does:

typeofs (default: true) -- Transforms typeof foo == "undefined" into foo === void 0. Note: recommend to set this value to false for IE10 and earlier versions due to known issues.

Tested locally and issue is fixed with this. But we need this in the build asap so our test environment can use this :)

@EECOLOR
Copy link
Member

EECOLOR commented Jul 26, 2018

comparisons: false might be an option as well

According to this issue the problem should be solved: mapbox/mapbox-gl-js#4359 (comment)

This is released in version 0.47

@jvandenaardweg
Copy link
Author

It seems the used library released a newer version (3.3.2) on NPM (not in their GitHub repo) which fixes the Mapbox problem. So we'll use that: https://www.npmjs.com/package/react-map-gl

I'll close this issue, since we resolved it that way.

Thanks for the tip!

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

2 participants