Cannot find namespace 'google' in angular 14

Viewed 96

@angular/google-maps version: 14.1.1

I am using angular 14 and implement google map using @angular/google-maps but through error Cannot find namespace 'google'.

Here is stackblitz link click...

2 Answers

Maybe your package doesn't installed successfully. First try this:

npm install @angular/google-maps --force

After that hard reload your app. It will works

As mentioned in the doc

The Google Maps JavaScript declaration files (see source files on GitHub) can be installed using NPM from the @types/google.maps package

Try this:

 npm i -D @types/google.maps
Related