Angular-google-maps: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).

Created on 13 Jan 2021  路  5Comments  路  Source: SebastianM/angular-google-maps

Issue description
ERROR in node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:41 - error TS2314: Generic type 'MapHandlerMap' requires 1 type argument(s).

51 subscribeToMapEvent(eventName: N): Observable ~~~~~
node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:94 - error TS2314: Generic type 'MapHandlerMap' requires 1 type argument(s).

51 subscribeToMapEvent(eventName: N): Observable

Steps to reproduce and a minimal demo of the problem
npm install @agm/core @types/googlemaps
add agmcoremodule to app.module.ts
add basic html to show the map on app.component.html
add lat and lng in app.component.ts
add the map height on app.component.[css|scss]

angular-google-maps, Angular, & any other relevant dependency versions
@agm/core: 3.0.0-beta.0
@angular/core: 9.1.13
@types/googlemaps: 3.43.1

Most helpful comment

work for me:

1 - dependencies -> "@agm/core": "1.0.0",
2 - devDependencies -> "@types/googlemaps": "^3.36.4",
3 - Delete node modules,
4 - Delete package.lock.json
5 - npm install
6 - ng serve

All 5 comments

As a temporary solution you can install @types/googlemaps: "3.39.12"

Hi there,
This workaround doesn't work for me.

@davidquintard Try explicitly setting it to 3.39.13, since 3.39.12 no longer appears to be available; i.e., in package.json:

"@types/googlemaps": "3.39.13",

work for me:

1 - dependencies -> "@agm/core": "1.0.0",
2 - devDependencies -> "@types/googlemaps": "^3.36.4",
3 - Delete node modules,
4 - Delete package.lock.json
5 - npm install
6 - ng serve

"@types/googlemaps": "^3.36.4",

Thanks man !!! you saved my life.

Was this page helpful?
0 / 5 - 0 ratings