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

IE11: Object doesn't support property or method 'includes' #194

Closed
jonaseberle opened this issue Mar 7, 2019 · 5 comments
Closed

IE11: Object doesn't support property or method 'includes' #194

jonaseberle opened this issue Mar 7, 2019 · 5 comments
Labels

Comments

@jonaseberle
Copy link

When including the geocoder, e.g. on https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/ ,
IE11 says Object doesn't support property or method 'includes'

I will investigate further to see how this could be circumvented. Happy for any idea.

@andrewharvey
Copy link
Collaborator

andrewharvey commented Mar 7, 2019

Good catch! It looks like it's coming from

if (!this.origin.includes('api.mapbox.com')) return false;

confirming String.includes isn't supported on IE, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes

For the time being you can try v3.1.1 which should work.

@scottsfarley93 did you want to address this?

@jonaseberle
Copy link
Author

Thank you @andrewharvey - that circumvents that problem but v3.1.1 uses Promises which IE11 does not have.
3.1.1 with this polyfill https://www.npmjs.com/package/promise-polyfill works.

@andrewharvey
Copy link
Collaborator

True, versions later than v2.3.0 need a promise-polyfill for older browsers. This stems from https://github.com/mapbox/mapbox-sdk-js#installation. We should do a better job of documenting this in the README, similar to https://github.com/mapbox/mapbox-sdk-js#installation.

@scottsfarley93
Copy link

I can fix this in the minor refactor I'm doing in #189.

I wonder if we can add some tests that capture regressions on IE11 going forward.

@scottsfarley93
Copy link

This should now be resolved in v3.1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants