Page 1 of 1

GMap - GMAP.js;55 Google not defined [Work around]

Posted: 06 Mar 2019, 23:08
by chrishj
React is showing the error:
ReferenceError: google is not defined
initMap
C:\OpenClassroom\BikeRace\bikerace2020-react\node_modules\react-scripts\node_modules\babel-loader\lib\index.js??ref--6-oneOf-2!C:\OpenClassroom\BikeRace\bikerace2020-react\node_modules\primereact\components\gmap\GMap.js:155

152 | _createClass(GMap, [{
153 | key: "initMap",
154 | value: function initMap() {
> 155 | this.map = new google.maps.Map(this.container, this.props.options);
| ^ 156 |

I have google defined:

Code: Select all

import React, {Component} from 'react';
//import {Link} from 'react-router-dom';
import {GMap} from 'primereact/gmap';
import {Dialog} from 'primereact/dialog';
import {InputText} from 'primereact/inputtext';
import {Button} from 'primereact/button';
import {Checkbox} from 'primereact/checkbox';
import {Growl} from 'primereact/growl';
var google ;

export class RiderLocation extends Component {

Re: GMap - GMAP.js;55 Google not defined [Work around]

Posted: 16 Mar 2019, 23:32
by chrishj
I have resolved the issue by using the Google API directly in the React app