mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Mapbox (3.1.2) + Meteor (2.15) + Cordova: t.familiesBySource undefined is not an object

Open RedDeathAt614 opened this issue 11 months ago • 2 comments

mapbox-gl-js version: 3.1.2

browser: Not browser, iOS and Android app

Hi!

This may be some entangled mess of Meteor, Cordova and Mapbox, but I thought I would bring this to the attention of somebody here in case somebody else stumbles upon this problem or maybe there's an easy fix as I would like to be able to use 3.1.2 if possible. Basically, I have been using Mapbox for a long while in our Meteor and Cordova-based app (still in development mode though) and I decided to upgrade our 2.15.0 to the latest 3.1.2 release a few days ago. As I did this I started getting this error:

Uncaught Error: TypeError: undefined is not an object (evaluating 't.familiesBySource[this.source]'):3:blob:http://localhost:12984/53bafcac-2a28-4733-af59-9f8e4944ddf0

And sometimes this: Uncaught Error: TypeError: undefined is not a function (near '...Map"};for(const[i,r]of e.entries())t[i]=...'):1213:http://localhost:12984/__cordova/packages/modules.js?hash=c8673b27a0d00ddff5133b0f45dc072f06823cf2

I thought for sure this was some messed up shit in my Meteor app as this has happened before but I was surprised to find that I could recreate it in a clean Meteor app with only Mapbox installed. Note the bug in question does not appear in the browser. It only appears in the mobile app (iOS, Android, iOS simulator) that you create with Meteor and the error only appears with version 3.1.2 of Mapbox. It goes away again with 2.15.0 (I have not tested intermediary versions of Mapbox).

This may be a very niche error and it may not even be with Mapbox, but I thought it most appropriate to share here. Please let me know if that is not the case and I'll move it some place else. I searched for this far and wide but couldn't find anything relating to this.

We're heads down with getting our app release ready so I may not have much time to help, but I'll try my best.

Steps to Trigger Behavior

  1. Install Meteor (and Xcode if you don't have it)
  2. Clone https://github.com/RedDeathAt614/Mapbox-meteor-cordova-weird
  3. Note this repo intentionally doesn't contain Mapbox yet
  4. Install Mapbox GL via meteor npm install --save [email protected]
  5. In a terminal run meteor
  6. In a browser, go to http://localhost:3000 and confirm that a map loads beautifully as expected
  7. In a new terminal run meteor build ../builds --server http://localhost:3000 --platforms=ios (you may need to create the folder ../builds first)
  8. Open ../builds/ios/project/Weird.xcodeproj
  9. In Xcode run the "Weird" app on the iOS simulator on an iPhone 15 for instance (but pick whatever you want)
  10. See that the map doesn't load and that the Xcode console shows the error t.familiesBySource error
  11. Go back to a terminal and run meteor npm remove mapbox-gl
  12. Run meteor npm install [email protected]
  13. Wipe contents of ../builds
  14. Run meteor build ../builds --server http://localhost:3000 --platforms=ios
  15. Run the app in Xcode simulator again and confirm that the map shows as it should and that the error now is now gone

Link to Demonstration

I've provided a test repo above and described how to get and prevent the bug from happening.

Expected Behavior

To see a map of the Earth without t.familiesBySource error.

Actual Behavior

See a partially rendered map with the t.familiesBySource error

RedDeathAt614 avatar Feb 28 '24 21:02 RedDeathAt614

Hi @RedDeathAt614, thanks for making an issue for that. Could you please check if the issue persists with the latest stable v3.2.0?

stepankuzmin avatar Mar 04 '24 10:03 stepankuzmin

I am so sorry about my late reply. For some reason I only noticed this now. Will check within a week or so.

RedDeathAt614 avatar Jul 08 '24 12:07 RedDeathAt614