# Google maps TypeScript error: Cannot find name 'google' - discussion

**URL:** <https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990>\
**Category:** ionic-v3\
**Created:** [April 21, 2016, 11:09am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990 "2016-04-21T11:09:58Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![rsa](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rsa](https://forum.ionicframework.com/u/rsa)\
**Post date:** [January 30, 2017, 9:17pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/21 "2017-01-30T21:17:19Z")

</div>

for persons like me that forget everything like me: do step 1,2 and 3 of @user2662006 answer in flowing link .

> <https://stackoverflow.com/questions/36064697/how-to-install-typescript-typings-for-google-maps>

---

<div class="post-metadata">

**Author:** ![BeliliFahem](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@BeliliFahem](https://forum.ionicframework.com/u/BeliliFahem)\
**Post date:** [February 8, 2017, 1:29pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/23 "2017-02-08T13:29:00Z")

</div>

> [@dpucar](#):
>
> 1. declare module ‘googlemaps’; into declarations.d.ts

How to do the step 3 ?

---

<div class="post-metadata">

**Author:** ![dpucar](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dpucar](https://forum.ionicframework.com/u/dpucar)\
**Post date:** [February 8, 2017, 6:16pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/24 "2017-02-08T18:16:14Z")

</div>

Just type  
**declare module ‘googlemaps’;**  
into your **declarations.d.ts**

---

<div class="post-metadata">

**Author:** ![RezaRahmati](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rezarahmati/32/105219_2.png) [@RezaRahmati](https://forum.ionicframework.com/u/RezaRahmati)\
**Post date:** [February 26, 2017, 2:59pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/25 "2017-02-26T14:59:05Z")

</div>

You are a savior! it works

---

<div class="post-metadata">

**Author:** ![dimitri320](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dimitri320/32/116022_2.png) [@dimitri320](https://forum.ionicframework.com/u/dimitri320)\
**Post date:** [March 3, 2017, 8:02pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/26 "2017-03-03T20:02:48Z")

</div>

Thanks, worked perfectly for me!

---

<div class="post-metadata">

**Author:** ![Manas007](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@Manas007](https://forum.ionicframework.com/u/Manas007)\
**Post date:** [April 20, 2017, 5:06pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/27 "2017-04-20T17:06:59Z")

</div>

I found same same error Cannot find name ‘google’

I follow same steps but error still persists.

Please look into this. I stuck in this from long time.

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/6/a/6a76fa3418f8b7df98afe5ada538f0c872e98f3d.jpg)

---

<div class="post-metadata">

**Author:** ![hainako](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hainako/32/112930_2.png) [@hainako](https://forum.ionicframework.com/u/hainako)\
**Post date:** [May 3, 2017, 10:17pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/28 "2017-05-03T22:17:29Z")

</div>

Just declare var google:any;

next to imports on Angular 4 or 2 component.

Happy Day Coding.

---

<div class="post-metadata">

**Author:** ![luukschoen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luukschoen/32/98585_2.png) [@luukschoen](https://forum.ionicframework.com/u/luukschoen)\
**Post date:** [May 17, 2017, 1:11pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/29 "2017-05-17T13:11:06Z")

</div>

Or just install the typings by running

`npm install @types/google-maps --save`

---

<div class="post-metadata">

**Author:** ![gnncrdm](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gnncrdm](https://forum.ionicframework.com/u/gnncrdm)\
**Post date:** [June 28, 2017, 9:03pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/30 "2017-06-28T21:03:31Z")

</div>

it worked for me thank you so much 👍

---

<div class="post-metadata">

**Author:** ![TobeeDev](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@TobeeDev](https://forum.ionicframework.com/u/TobeeDev)\
**Post date:** [July 9, 2017, 10:37am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/31 "2017-07-09T10:37:34Z")

</div>

i got new error after i followed all replies:

> iCannot read property ‘Autocomplete’ of undefined

---

<div class="post-metadata">

**Author:** ![Technbuzz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/technbuzz/32/110789_2.png) [@Technbuzz](https://forum.ionicframework.com/u/Technbuzz)\
**Post date:** [October 18, 2017, 7:22am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/32 "2017-10-18T07:22:53Z")

</div>

I am not using a native google map but even with Javascript api I faced the same issue which by first installing the types with

`npm install @types/google-maps --save`

and then including following two lines

```auto
import { google } from "google-maps";

declare var google : google;

```

---

<div class="post-metadata">

**Author:** ![iMitulPatel](https://avatars.discourse-cdn.com/v4/letter/i/e5b9ba/32.png) [@iMitulPatel](https://forum.ionicframework.com/u/iMitulPatel)\
**Post date:** [November 4, 2017, 5:45am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/33 "2017-11-04T05:45:44Z")

</div>

Just add

declare var google;

after import in your component diles.

---

<div class="post-metadata">

**Author:** ![sahajarora1286](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@sahajarora1286](https://forum.ionicframework.com/u/sahajarora1286)\
**Post date:** [November 26, 2017, 12:17pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/34 "2017-11-26T12:17:43Z")

</div>

It works! Thank you so much!

---

<div class="post-metadata">

**Author:** ![Ben1nB1ack](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ben1nb1ack/32/114904_2.png) [@Ben1nB1ack](https://forum.ionicframework.com/u/Ben1nB1ack)\
**Post date:** [November 26, 2017, 5:33pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/35 "2017-11-26T17:33:35Z")

</div>

as an alternative you can just use this guys setup.

It runs in browser, devapp, ionic view. etc…

[https://github.com/ng2-ui/map#usage](https://github.com/ng2-ui/map#usage)

---

<div class="post-metadata">

**Author:** ![itaionic](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@itaionic](https://forum.ionicframework.com/u/itaionic)\
**Post date:** [February 27, 2018, 4:20am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/36 "2018-02-27T04:20:49Z")

</div>

Hey there! I have the Elite version of this app and getting a similar error (See screenshot)

 ![Capture](https://global.discourse-cdn.com/ionicframework/original/3X/a/a/aa4fae894cd01ed3c45946ac1f08bdcbc801b302.GIF)  
followed all of the suggestions above, but nothing seems to work. Any other suggestions?! 😕

_This might help:_  
_Ionic Framework: ^3.9.2_  
_Ionic App Scripts: 3.1.8_  
_Angular Core: 5.0.1_  
_Angular Compiler CLI: 5.0.1_  
_Node: 6.10.0_  
_OS Platform: Windows 10_  
_Navigator Platform: Win32_  
_User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36_

---

<div class="post-metadata">

**Author:** ![dayanajabif](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dayanajabif/32/126298_2.png) [@dayanajabif](https://forum.ionicframework.com/u/dayanajabif)\
**Post date:** [February 27, 2018, 7:41pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/37 "2018-02-27T19:41:15Z")

</div>

**Try the following in your project:**

npm install @types/googlemaps --save  
npm install typings --global  
typings install dt~google.maps --global

---

<div class="post-metadata">

**Author:** ![itaionic](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@itaionic](https://forum.ionicframework.com/u/itaionic)\
**Post date:** [February 27, 2018, 9:18pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/38 "2018-02-27T21:18:30Z")

</div>

Yes I did. also had the line

with my API key.  
still same issue.  
Noticed an error on my index.d.ts, Map class, but might just be my ide… (see screenshot)

 ![Capture2](https://global.discourse-cdn.com/ionicframework/original/3X/6/9/6922bf155b3e1c1d1e085f46a370405cc548c7db.GIF)  
Any other suggestions?

---

<div class="post-metadata">

**Author:** ![dayanajabif](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dayanajabif/32/126298_2.png) [@dayanajabif](https://forum.ionicframework.com/u/dayanajabif)\
**Post date:** [March 1, 2018, 12:43pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/39 "2018-03-01T12:43:16Z")

</div>

In case this helps anyone, with @itaionic we discover that the fix is:

Install google-maps lib:

```auto
npm install google-maps --save

```

then in your Typescript file add:

```auto
import { google } from "google-maps";

```

And also define the following property:

`google: google;`

---

<div class="post-metadata">

**Author:** ![hanssen](https://avatars.discourse-cdn.com/v4/letter/h/73ab20/32.png) [@hanssen](https://forum.ionicframework.com/u/hanssen)\
**Post date:** [August 29, 2018, 1:56pm UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/40 "2018-08-29T13:56:31Z")

</div>

Finally this works for me. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![salvatojalva](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/salvatojalva/32/123793_2.png) [@salvatojalva](https://forum.ionicframework.com/u/salvatojalva)\
**Post date:** [January 21, 2019, 2:03am UTC](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990/41 "2019-01-21T02:03:58Z")

</div>

Thank you! this works for me.

[Previous page](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990.md?page=1)

[Next page](https://forum.ionicframework.com/t/google-maps-typescript-error-cannot-find-name-google-discussion/49990.md?page=3)
