mapbox / mapbox/mapbox-gl-js

Uncaught ReferenceError: __async is not defined

Open
#13,684 10 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle: bundlers
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### mapbox-gl-js version

v3.24.1

### Browser and version

_No response_

### Expected behavior

After upgrading mapboxgl from v3.16.0 to v3.24.1 I receive the below error when my code in Angular 22 executes the line `new mapboxgl.Map({`
In version v3.16 the error does not occur
the error is

Image

`An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'`

### Actual behavior

_No response_

### Link to the demonstration

_No response_

### Steps to trigger the unexpected behavior

_No response_

### Relevant log output

```shell

```

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 reproducing the reported upgrade from mapboxgl v3.16.0 to v3.24.1 in Angular 22 and read the transpiling guidance linked in the issue. Compare the worker-bundle behavior around `new mapboxgl.Map({` and determine what is needed for the worker to load without the `__async` ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.