Wykks / ngx-mapbox-gl

Angular binding of mapbox-gl-js
https://wykks.github.io/ngx-mapbox-gl
MIT License
344 stars 139 forks source link

Imports are immutable in JavaScript - esbuild error #403

Closed BojanKogoj closed 11 months ago

BojanKogoj commented 1 year ago

I'm trying Jest on Angular 16 which uses esbuild, and get the following error

X [ERROR] Cannot assign to import "baseApiUrl"

    node_modules/ngx-mapbox-gl/fesm2022/ngx-mapbox-gl.mjs:34:25:
      34 │                 MapboxGl.baseApiUrl = options.customMapboxApiUrl;
         ╵                          ~~~~~~~~~~

  Imports are immutable in JavaScript. To modify the value of this import, you must export a setter function i

The issue seems to be this line. Which is weird, because baseApiUrl is already a setter. The only solution I found was modifying request instead.

Issue for introducing error to esbuild.

Using

harellevy commented 11 months ago

Same here...

Anakii commented 11 months ago

same for me, also opened an issue https://github.com/Wykks/ngx-mapbox-gl/issues/407

BojanKogoj commented 5 months ago

@Wykks Can you please release a new version with this fix?