mapbox / mapbox/mapbox-gl-directions

Package import broken without build

Open
#269 0 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

The distribution currently does not include built files. In version 3.1.3 this was included at `dist/`. Even then it was not documented but [people found a workaround to use this in their code](https://github.com/mapbox/mapbox-gl-directions/issues/157#issuecomment-566061339).

Please return to publishing the dist directory and ideally change the main entry point to that as well (or visibly document how to import this lib for use in a browser environment).

C.f. https://mykeels.medium.com/node-how-to-handle-your-dist-files-9667f47316ab

Thanks!

**Edit:** If anybody finds this issue looking for a way to use `mapbox-gl-directions` in a Webpack setup, I was able to work around this issue by including the [full bundle](https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.0/mapbox-gl-directions.js) as well as the [css definitions](https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.0/mapbox-gl-directions.css) in my source code. In addition, I had to use `import * as MapboxDirections` for the import and manually call `directions.mapState()` after adding the control to my (fully loaded) map instance.

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 by inspecting the package publishing and entry-point configuration, focusing on whether the dist directory is generated and included in releases. Compare the current package contents with version 3.1.3, then verify that a browser or Webpack import works and that the intended usage is documented if the entry point is not changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.