mapbox / mapbox/mapbox-gl-language
Wrong typings for ESM module
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 204
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
# Problem
TypeScript with ESM modules fails to compile a program importing this `@mapbox/mapbox-gl-language` package.
```typescript
import language from "@mapbox/mapbox-gl-language";
// This `default` property is `undefined`.
console.log(language.default);
// This `language` default export is the actual constructor. But this leads to a compile error.
const control = new language();
```
# References
- [A reproduction package](https://github.com/mapbox/raviqqe/tree/main/mapbox-gl-esm-typing)
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 with the linked reproduction package and its TypeScript ESM import of @mapbox/mapbox-gl-language. Compare the declared default export with the runtime value shown in the issue, then verify that the reproduction compiles while constructing the imported language control without accessing an undefined default property.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100