maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.29k stars 685 forks source link

standard-minifier-js of Meteor.js remove Promise #4001

Open rtalon83 opened 4 months ago

rtalon83 commented 4 months ago

A Meteor.js v2.5.8 web application using MapLibre 4.1.2 to show a simple map in a dashboard. Simple mongo links and show differents layers. In development mode all is ok. But, When is production mode the app not run.

dist/maplibre-gl.js has this functions:

image

Promise is changed for arbitrary variable/string, in this case 'n'

image

maplibre-gl-js version: 4.1.2

browser: Chrome 123.0.6312.123

Steps to Trigger Behavior

  1. Create a new package from Meteor.js adding maplibre-gl library
  2. Set this package in packages folder.
  3. Build in production mode
  4. Map is visible but the communications are broken.

Consider using the non-minified version for this demo to create better error messages. E.g. <script src='https://unpkg.com/maplibre-gl@1.15.2/dist/maplibre-gl-dev.js'></script><link href='https://unpkg.com/maplibre-gl@1.15.2/dist/maplibre-gl.css' rel='stylesheet' />

See https://stackoverflow.com/help/mcve for guidelines on creating an effective example. -->

Expected Behavior

Actual Behavior

HarelM commented 4 months ago

It is not clear what the problem is and how to reproduce it. This looks like a bad behavior of a minifier that didn't do its job well, I'm not sure how this is related to maplibre...? I see the word promise in both: https://unpkg.com/browse/maplibre-gl@4.1.2/dist/maplibre-gl-dev.js and https://unpkg.com/browse/maplibre-gl@4.1.2/dist/maplibre-gl.js

rtalon83 commented 4 months ago

Yes, is a bad behaviour of a minifier of Meteor.js, I don't know why... I write this issue because perhaps someone else has experienced the same thing. Thanks.

birkskyum commented 1 month ago

@rtalon83 , is this still a problem with Meteor.js v3? It has e.g. replaced the quite problematic meteor Fibers with native async/await support, so I think there's a good chance it might solve the issue.

rtalon83 commented 1 month ago

I have not tested my app with meteor.js v3, yet. But I resolved my problem changing the strategy (no package, code inside the main app). My next test will be check v3

El lun., 5 ago. 2024 15:51, Birk Skyum @.***> escribió:

@rtalon83 https://github.com/rtalon83 , is this still a problem with Meteor.js v3? It has e.g. replaced the fibers with native async/await support, so it could make a difference.

— Reply to this email directly, view it on GitHub https://github.com/maplibre/maplibre-gl-js/issues/4001#issuecomment-2269130736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3S7DH3JXJMCPFR257ZAMTZP57MRAVCNFSM6AAAAABGHG4VF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRZGEZTANZTGY . You are receiving this because you were mentioned.Message ID: @.***>