angular-material-extensions / google-maps-autocomplete

Autocomplete input component and directive for google-maps built with angular and material design |
https://angular-material-extensions.github.io/google-maps-autocomplete
MIT License
169 stars 60 forks source link

TypeError: Cannot read property 'Autocomplete' of undefined #290

Closed knroy closed 4 years ago

knroy commented 4 years ago

I have followed doc. But getting this error.

TypeError: Cannot read property 'Autocomplete' of undefined
    at angular-material-extensions-google-maps-autocomplete.js:990
    at ZoneDelegate.invoke (zone-evergreen.js:364)
    at Object.onInvoke (core.js:41654)
    at ZoneDelegate.invoke (zone-evergreen.js:363)
    at Zone.run (zone-evergreen.js:123)
    at zone-evergreen.js:857
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:41632)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)
    at Zone.runTask (zone-evergreen.js:167)

package.json:

"dependencies": {
    "@agm/core": "^1.0.0-beta.7",
    "@angular-material-extensions/google-maps-autocomplete": "^3.2.1",
    "@angular/animations": "~9.1.11",
    "@angular/common": "~9.1.11",
    "@angular/compiler": "~9.1.11",
    "@angular/core": "~9.1.11",
    "@angular/flex-layout": "^9.0.0-beta.31",
    "@angular/forms": "~9.1.11",
    "@angular/material": "^9.2.4",
    "@angular/material-moment-adapter": "^9.2.4",
    "@angular/platform-browser": "~9.1.11",
    "@angular/platform-browser-dynamic": "~9.1.11",
    "@angular/router": "~9.1.11",
    "@auth0/angular-jwt": "^4.2.0",
    "@ckeditor/ckeditor5-angular": "^1.2.3",
    "@ecs/core": "^1.0.41",
    "@ecs/datatable": "0.0.5",
    "@ecs/icons": "0.0.11",
    "@fortawesome/fontawesome-free": "^5.13.0",
    "@mat-datetimepicker/core": "^4.1.0",
    "@mat-datetimepicker/moment": "^4.1.0",
    "@types/googlemaps": "^3.39.6"
}

View

<mat-form-field [floatLabel]="'always'" fxFlex>
        <input matInput
               matGoogleMapsAutocomplete
               placeholder="Address" type="text" formControlName="Address" required
               (onAutocompleteSelected)="onAutocompleteSelected($event, i)"
               (onLocationSelected)="onLocationSelected($event, i)">
        <mat-error>Address is required</mat-error>
      </mat-form-field>
AnthonyNahas commented 4 years ago

you are using an outdated version!

please use v4