mapbox / mapbox/mapbox-gl-directions

mapbox-gl-directions.js: Object dosen´t support property or method 'assign on IE11

Open
#123 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug
Dominant language
JavaScript
Stars
255
Forks
130
PR merge metrics
No merged PRs in 30d

Description

Migrated from https://github.com/mapbox/mapbox-gl-js/issues/4316, originally by @Liverson

> Hello,
>
> on IE11 there is an error when i use mapbox-gl-directions.js to set waypoints on my map.
> On all other browsers incl. Edge the waypoints are shown fine.
> I tested with mapbox-gl-directions v3.0.3 and 3.1.1
>
> I got the following error message in the console:
> _Object dosen´t support property or method 'assign'_
> _mapbox-gl-directions.js (6518,7)_
>
> Breakpoint in mapbox-gl-directions.js:
> _this.originInput = new _geocoder2.default(Object.assign {} ...._
>
> When i comment out the following code, the page loading without errors.
> Seems map.addControl(directions) triggers the issue
>
> ```
> var directions = new MapboxDirections({
> accessToken: mapboxgl.accessToken,
> unit: 'metric',
> profile: 'cycling',
> controls: false,
> interactive: false
> });
>
> map.addControl(directions);
> ```
> Greets,
> Oliver

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with mapbox-gl-directions.js around line 6518 and reproduce the failure by calling map.addControl with the directions configuration shown. Check how the Object.assign call is handled for IE11 compatibility. Done means adding the directions control no longer raises the reported Object.assign error in IE11 while preserving the existing behavior in other browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.