Mapbox (3.1.2) + Meteor (2.15) + Cordova: t.familiesBySource undefined is not an object
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**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 mapbox-gl@3.1.2`
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 mapbox-gl@2.15.0`
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
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 Mapbox-meteor-cordova-weird reproduction and follow the Meteor build steps for an iOS simulator using mapbox-gl@3.1.2. Compare the simulator behavior and console errors with mapbox-gl@2.15.0; done means the mobile map renders without the familiesBySource error while the browser behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100