-
Notifications
You must be signed in to change notification settings - Fork 109
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
Uncaught ReferenceError: a is not defined
with mapbox-gl in production mode
#251
Comments
Thanks for sharing a working reproduction, I can confirm I see the bug. |
@ef4 found the solution. We must exclude the Also ember-auto-import is a great tool. Thanks a lot for maintaining it. 💯 to every contributor :-) |
Thanks for the update. Yes, skipBabel needs to get added to the readme, we have an open issue for that. I think it's a fine workaround to this problem. But I am still curious exactly what is breaking and I might dig in further. It's a little surprising that it breaks only in production, even after I remove uglify. That implies that either babel or webpack is doing something different in prod that results in invalid code. |
That maybe because mapbox is using a separate dev package for the dev build and a transpiled one in prod. Also I included a PR for the README update. Please let me know how it looks :) |
a
in the error sometimes becomesn
, I suppose due to dynamic naming at minificationRepo 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 inember-auto-import
/webpack
combo.Versions:
The text was updated successfully, but these errors were encountered: