A
A
aris-paskalov2021-12-28 12:29:23
typescript
aris-paskalov, 2021-12-28 12:29:23

Why doesn't TypeScript see the google object?

I'm learning TS using google maps as an example.

Connecting JS files looks like this:

61cad83bb3fe2341226615.png

Typescript file:

61cad869b20a8014098012.png

For some reason, the "google" object is not in the code, although the script is connected before my app.js file:

61cad8d14b8d1078696907.png

When I worked with vanilla JS (without tsa), the google object was and everything was OK.

Please tell me what could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2021-12-28
@aris-paskalov

The object exists, but its types do not exist.
npm i -D @types/google.maps
This is indicated by the very first line in the documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question