"exclude must be a string." error using mbxDirections in mapbox-sdk-js 13.3
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 768
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
Our team has been using `mbxDirections` to calculate road distance using Mapbox for ~2 months with the following configs.
```
await directionsService
.getDirections({
profile: 'driving',
waypoints: stops.map((s) => ({
coordinates: [s.longitude, s.latitude],
})) as DirectionsWaypoint[],
geometries: 'polyline',
overview: 'full',
steps: true,
exclude: ['ferry'],
})
.send();
```
However, our API stopped working and started seeing `Error: exclude must be a string.` since 7/12/22.
I tried updating to the latest (13.4) of the sdk, and the same issue still remains.
I tried removing the sdk and instead querying the endpoint directly with the following CURL and it works
```
curl --location --request GET 'https://api.mapbox.com/directions/v5/mapbox/driving/-122.393806%2C37.786041%3B-122.401527%2C37.788712?geometries=polyline&overview=full&steps=true&exclude=ferry&access_token=
```
I would like to confirm with mapbox that this is due to an API change that isn't being reflected in the sdk client. Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the mbxDirections directionsService.getDirections(...).send() request path and inspect how the exclude option is serialized. Compare the SDK request with the working curl example, then verify that the resulting request accepts the documented ferry exclusion and add or run coverage for this configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100