question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MapView is broken on web

See original GitHub issue

šŸ› Bug Report

Summary of Issue (just a few sentences)

I’ve seen this issue brought up before, but have found no solutions. MapView doesn’t work with Expo running on the web. You can see this just by trying the Snack linked in this documentation:

https://docs.expo.io/versions/latest/sdk/map-view/

The error seems to either be (Snack):

(0 , g.requireNativeComponent) is not a function
  Evaluating react-native-maps.js
  Evaluating App.js
  Loading App.js

Or (locally): TypeError: Object(...) is not a function

Environment - output of expo diagnostics & the platform(s) you’re targeting

Expo CLI 3.21.5 environment info: System: OS: macOS Mojave 10.14.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 13.3.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.2 - /usr/local/bin/npm IDEs: Xcode: /undefined - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ^0.12.14 => 0.12.14 expo: ^37.0.12 => 37.0.12 react: ~16.9.0 => 16.9.0 react-dom: ~16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 react-native-web: ~0.11.7 => 0.11.7 npmGlobalPackages: expo-cli: 3.21.5

Reproducible Demo

To Reproduce On Expo Web

...
import { MapView } from 'react-native-maps';

<View style={styles.mapContainer}>
     <MapView
          style={{ marginTop: 20, width: "80%", height:400 }}
          initialRegion={{
            latitude: 37.78825,
            longitude: -122.4324,
          }}
     />
</View>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
EvanBaconcommented, Jul 27, 2020

Unfortunately I don’t have time to work on this feature right now. It’s a really large project with lot’s of differences between web and native. The developer interface should probably change as well to be more universal and support any arbitrary map service (i.e. Leaflet, Mapbox, Apple maps, Google maps).

The best solution would be to create a new maps package, but that would take a ton of time to create and maintain. I would recommend using the extremely unstable fork for now.

0reactions
vrinchcommented, Aug 24, 2020

the maker works on system browsers, however, when I try to use markers on mobile browsers, it keeps showing a blank screen without any error whatsoever

Read more comments on GitHub >

github_iconTop Results From Across the Web

MapView.goTo() is not working and throwing a weird error
I'm using angular with esri maps. I'm trying to use the goTo() method of a mapView. I'm getting a weird error with an...
Read more >
MapView | API Reference | ArcGIS Maps SDK for JavaScript ...
A MapView displays a 2D view of a Map instance. An instance of MapView must be created to render a Map (along with...
Read more >
ArcGIS Javascript API not loading portal web map
You have somehow mixed two modules into one, in a weird broken way. Your imports MapView , WebMap , domReady! and config need...
Read more >
Catch mapview-query-error of ArcGIS MapView - Stack Overflow
I am using the ArcGIS for Javascript library 4.22 and I am trying to run some code when tiles cannot be fetched correctly...
Read more >
Embedded map view troubleshooting - AppGyver forums
The search result for the map component is a broken image icon, ... Note that the beta version only works on iOS and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found