Why am I getting an import error when trying to use react-native-maps?

Viewed 382

Quick version:

expo init MyNewProject

cd MyNewProject

expo install react-native-maps

add import MapView from 'react-native-maps' to the top of my App.js, save/reload and I get the following error screen, along with this warning in the Expo Dev Tools

C:/Users/MyUser/Projects/current/MapTest/node_modules/react-native-maps/lib/components/MapView.js Attempted import error: 'requireNativeComponent' is not exported from 'react-native-web/dist/index'.

: build error

Long Version:

I created a brand new react-native app using expo, via expo init MyNewProject and chose a blank template. I then installed react-native-maps into my project directory as detailed here, https://docs.expo.io/versions/latest/sdk/map-view/, by running expo install react-native-maps. At this point I haven't touched the code, other than adding an import in my App.js for the MapView component import MapView from 'react-native-maps'. Now, when I save/reload the app, it dies. What's happening?? Am I missing something or is this a bug?

0 Answers
Related