js-api-loader icon indicating copy to clipboard operation
js-api-loader copied to clipboard

reference type google.maps directive missing from 1.6.10

Open andyexeter opened this issue 6 months ago • 5 comments

Hey there,

Up until v1.6.8 of this package the following line was included in dist/index.d.ts:

/// <reference types="google.maps" />

Since updating to v1.6.10 I noticed this line has been removed. This is causing breakage across our CI/CD workflows with code like this:

// my-map.ts
let map: google.maps.Map;

Now erroring with:

"error TS2503: Cannot find namespace 'google'."

Looking through the changelog I can't really see why the line was removed. Was this intentional or an unintentional side effect of a dependency update?

Adding the removed type reference to my-map.ts resolves the issue but it'd be good to know if this is planned to be added back in before I have to go update a load of different projects 😅

andyexeter avatar Jun 26 '25 14:06 andyexeter

Can you check if adding @types/google.maps as a dependency in your project fixes this?

I'm not sure why the reference was there and what happened to it, but if you're using the google maps types in your typescript files, you should also install them yourself and I believe this should also make this error go away.

usefulthink avatar Jul 11 '25 15:07 usefulthink

I have had @types/google.maps (currently 3.58.1) in my project since the beginning and the issue still popped up.

whydoievenneedthis avatar Jul 12 '25 06:07 whydoievenneedthis

We also already have @types/google.maps added as a dependency in our projects, we added it at the same time as this package.

andyexeter avatar Jul 14 '25 10:07 andyexeter

Thanks, I'll look into it.

usefulthink avatar Jul 14 '25 11:07 usefulthink

I think the line /// <reference types="google.maps" /> lead to the types being available in the global namespace without having to import the types.

julianpung avatar Jul 18 '25 14:07 julianpung