Skip to content

Uncaught ReferenceError: a is not defined with mapbox-gl in production mode #251

@kasunvp

Description

@kasunvp

a in the error sometimes becomes n, I suppose due to dynamic naming at minification

Repo for reproduction: https://github.com/kasunvp/mapbox-gl-test (minimal app)

Error with ember serve --prod (can see the error even without the mapbox-gl access token)
Works with ember serve (have to add a mapbox-gl access token to load the map)

The interesting fact is that we've been using ember-auto-import + mapbox-gl for some time now. Had a same kind of issue with a previous version, it was resolved and was working fine after using the ember-auto-import configuration noParse: /(mapbox-gl)\.js$/ as was suggested somewhere. But not anymore with the latest versions.

Also, if the deprecated ember-browserify addon is used instead of ember-auto-import, it works fine too. So must be an issue in ember-auto-import/webpack combo.

Versions:

  • Ember: v3.12.0
  • ember-auto-import: v1.5.3
  • mapbox-gl: v1.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions