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

Created on 6 Oct 2020  ·  18Comments  ·  Source: SebastianM/angular-google-maps

I encountered error in my terminal when I execute ng build or ng serve:

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

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

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;

Most helpful comment

You can rollback to v3.39.13 of @type/googlemaps (npm i @types/[email protected])

All 18 comments

Same error, Angular V9, fresh install

Hello,

What is your AGM version ?

Just downloaded, @agm/[email protected] from package.json

Da: Pierre Steiniernotifications@github.com

Hello,

What is your AGM version ?

Yep, i've got the same error since i updated @types/googlemaps...

You can rollback to v3.39.13 of @type/googlemaps (npm i @types/[email protected])

Yes, installing @types/[email protected] solved the issue.

it worked thanks

For me it was also @googlemaps/markerclustererplus that got an update

Yep, same issue here - seems like rollback of @type/googlemaps fixes this.

You can rollback to v3.39.13 of @type/googlemaps (npm i @types/[email protected])

I encountered error in my terminal when I execute ng build or ng serve:

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

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

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;

install

npm install @types/[email protected] --save-dev

Is it any plan to update this type to the latest version of @types/googlemaps?

Error: 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 ~~~~~

You can rollback to v3.39.13 of @type/googlemaps (npm i @types/[email protected])

thank you so much. it is working for me.<3

@guri1497 for me, too, it solved the problem😊

I have the same issue, but a weird one, the normal build working fine for me with ng build --prod but when I build my Docker image then I have this issue!

BTW:

"@types/googlemaps": "3.39.12",
"@agm/core": "^3.0.0-beta.0",
"@angular/core": "~10.1.1",

Any similar behavior?

@hamzahsn you need to change the "@types/googlemaps": "3.39.12", to "@types/[email protected]"

@EfratIfergan I have tried them both actually but did not work

You can rollback to v3.39.13 of @type/googlemaps (npm i @types/[email protected])

this worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vamsibassetty08 picture vamsibassetty08  ·  3Comments

Subhojit1992 picture Subhojit1992  ·  3Comments

maneesht picture maneesht  ·  3Comments

alexweber picture alexweber  ·  4Comments

DeveloperAdd007 picture DeveloperAdd007  ·  3Comments