pieterv / react-googlemaps

A declarative React interface to Google Maps
MIT License
226 stars 68 forks source link

Wall of errors when using in ES6 project #39

Open sebastialonso opened 8 years ago

sebastialonso commented 8 years ago

This looks like the simplest library for GoogleMaps, so I decided to try it. Importing thins like this

import React, { Component } from 'react'
import ReactGoogleMaps, { Map, Marker, OverlayView } from 'react-googlemaps'
const GoogleMapsAPI = window.google.maps

class Example extends Component {
...

Also, I have the google maps script in index.html

But all I get is

ERROR in ./~/react-googlemaps/src/ReactMapComponents.js
Module not found: Error: Cannot resolve module 'react/lib/mapObject' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src
 @ ./~/react-googlemaps/src/ReactMapComponents.js 4:16-46

ERROR in ./~/react-googlemaps/src/ui/components/ReactMap.js
Module parse failed: /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui/components/ReactMap.js Line 55: Unexpected token <
You may need an appropriate loader to handle this file type.
|     if (this.state.mapLifeCycleState !== MapLifeCycle.CREATING_HOLDER) {
|       map = (
|         <GoogleMapsMap
|           {...this.props}
|           ref="map"
 @ ./~/react-googlemaps/src/ui/ReactDefaultInjection.js 7:15-47

ERROR in ./~/react-googlemaps/src/ui/components/ReactOverlayView.js
Module parse failed: /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui/components/ReactOverlayView.js Line 36: Unexpected token <
You may need an appropriate loader to handle this file type.
| 
|   React.render(
|     cloneWithProps(<div />, props),
|     this._containerElement
|   )
 @ ./~/react-googlemaps/src/ui/ReactDefaultInjection.js 8:23-63

ERROR in ./~/react-googlemaps/src/ui/components/ReactFrag.js
Module parse failed: /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui/components/ReactFrag.js Line 24: Unexpected token <
You may need an appropriate loader to handle this file type.
| 
|     return (
|       <span>{children}</span>
|       );
|   }
 @ ./~/react-googlemaps/src/ui/ReactDefaultInjection.js 9:16-49

ERROR in ./~/react-googlemaps/src/ui/MapOption.js
Module not found: Error: Cannot resolve module 'react/lib/invariant' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui
 @ ./~/react-googlemaps/src/ui/MapOption.js 3:16-46

ERROR in ./~/react-googlemaps/src/ui/MapEvent.js
Module not found: Error: Cannot resolve module 'react/lib/invariant' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui
 @ ./~/react-googlemaps/src/ui/MapEvent.js 3:16-46

ERROR in ./~/react-googlemaps/src/GoogleMapsAPI.js
Module not found: Error: Cannot resolve module 'react/lib/invariant' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src
 @ ./~/react-googlemaps/src/GoogleMapsAPI.js 3:16-46

ERROR in ./~/react-googlemaps/src/ui/ReactMapComponent.js
Module not found: Error: Cannot resolve module 'react/lib/invariant' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui
 @ ./~/react-googlemaps/src/ui/ReactMapComponent.js 4:16-46

ERROR in ./~/react-googlemaps/src/ui/ReactMapComponentMixin.js
Module not found: Error: Cannot resolve module 'react/lib/invariant' in /home/seba/repos/test_applications/react-redux-cordova-boilerplate/node_modules/react-googlemaps/src/ui
 @ ./~/react-googlemaps/src/ui/ReactMapComponentMixin.js 4:16-46

What's going on here?

UPDATE: exactly the same thing is happening with the examples repo. I'm starting to think it's not me messing things up

jontonsoup commented 8 years ago

also getting this error

fleetofthemalden commented 8 years ago

I'm getting the first error

factoryhr commented 8 years ago

+1

chappydboz commented 8 years ago

+1

dmitriid commented 8 years ago

Same here. Also see #37 #38

dmitriid commented 8 years ago

To anyone. Use petehunt/react-googlemaps or commit feb6e71 to get rid of these errors