react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

Can't find variable: google

Open adrienharnay opened this issue 7 years ago • 4 comments

Getting Help

Before doing this, did you:

  1. Read the documentation yup
  2. Read the source code yup

Hey,

I have Sentry reports about an error coming from this line.

Snippet: com/tomchentw/react-google-maps/pull/168");var t=new google.maps.Map(e);this.setState({map:t})}}},{key:"render",value:function(){var e=this.

It happens when using the module with uBlock installed. I could open a PR, but would like some guidance before doing the work. I am thinking about a onError prop, fired when this case happens.

What do you think?

Thanks in advance :)

adrienharnay avatar Mar 06 '18 16:03 adrienharnay

Having the same problem here. But it have only happend once and only on:

Mobile Safari: Version: 11.0 iOS: Version: 11.4.1 iPhone

"react-google-maps": "^9.4.5",

image

ReferenceError: Can't find variable: google
  at apply(../node_modules/react-google-maps/lib/withGoogleMap.js:149:1)
  at wrapper(../node_modules/react-google-maps/node_modules/lodash/_createBind.js:23:1)
  at ai(../node_modules/react-dom/cjs/react-dom.production.min.js:221:130)
  at Vh(../node_modules/react-dom/cjs/react-dom.production.min.js:212:214)
  at Yh(../node_modules/react-dom/cjs/react-dom.production.min.js:211:277)
  at Wh(../node_modules/react-dom/cjs/react-dom.production.min.js:211:113)
  at Ah(../node_modules/react-dom/cjs/react-dom.production.min.js:209:244)
  at og(../node_modules/react-dom/cjs/react-dom.production.min.js:207:316)
  at enqueueSetState(../node_modules/react-dom/cjs/react-dom.production.min.js:148:225)
  at setState(../node_modules/react/cjs/react.production.min.js:12:344)
  at apply(../node_modules/react-google-maps/lib/withScriptjs.js:116:1)
  at wrapper(../node_modules/react-google-maps/node_modules/lodash/_createBind.js:23:1)
  at callback(../node_modules/scriptjs/dist/script.js:48:1)
  at ? (../node_modules/scriptjs/dist/script.js:82:1)

yoieh avatar Oct 26 '18 08:10 yoieh

I have the exact same Sentry report as @yoieh. It happens infrequently.

matttk avatar Jul 05 '19 09:07 matttk

+1

gabimoncha avatar Apr 23 '20 10:04 gabimoncha

The repo of this project is unmaintained more than a year, and we had build new version https://www.npmjs.com/package/@react-google-maps/api

We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can enjoy autocomplete.

You can see our docs: https://react-google-maps-api-docs.netlify.app

Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.app/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples

The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api

Our Spectrum community: https://spectrum.chat/react-google-maps
Our Slack channel: https://join.slack.com/t/react-google-maps-api/shared_invite/enQtODc5ODU1NTY5MzQ4LTBiNTYzZmY1YmVjYzJhZThkMGU0YzUwZjJkNGJmYjk4YjQyYjZhMDk2YThlZGEzNDc0M2RhNjBmMWE4ZTJiMjQ

Enjoy!

JustFly1984 avatar Apr 24 '20 12:04 JustFly1984