Definitelytyped: [@types/googlemaps] Type Node not found

Created on 17 Jul 2020  路  3Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [X] I tried using the @types/googlemaps package and had problems.
  • [X] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [X] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @cgwrench @nertzy @xaolas @martincostello @svenkreiss @bolatovumar @gauthierm @captain-igloo @demensky @life777 @simonhaenisch @gshigeto @Bat-Orshikh

If you do not mention the authors the issue will be ignored.

Hello,

I tried to import these types to use the Google Maps Javascript API. Unfortunately, when I build my own api, I encounter the following errors :

node_modules/@types/googlemaps/index.d.ts:94:32 - error TS2304: Cannot find name 'Node'.
94         constructor(container: Node, opts?: SaveWidgetOptions);

node_modules/@types/googlemaps/reference/info-window.d.ts:89:32 - error TS2304: Cannot find name 'Node'.
89         getContent(): string | Node;

node_modules/@types/googlemaps/reference/info-window.d.ts:125:38 - error TS2304: Cannot find name 'Node'.
125         setContent(content: string | Node): void;

node_modules/@types/googlemaps/reference/info-window.d.ts:163:28 - error TS2304: Cannot find name 'Node'.
163         content?: string | Node;

node_modules/@types/googlemaps/reference/map.d.ts:385:34 - error TS2304: Cannot find name 'Node'.
385         controls: Array<MVCArray<Node>>;

node_modules/@types/googlemaps/reference/street-view.d.ts:4:34 - error TS2304: Cannot find name 'Node'.
4         controls: Array<MVCArray<Node>>;

Is it normal to depend on a type that is not a basic type? Should I add another type definition to get the Node type? Should I already have it?

Thanks for your help!

Most helpful comment

Yeah you might just be missing lib: ["dom"].

All 3 comments

Please provide an example of your tsconfig.json.

Yeah you might just be missing lib: ["dom"].

Indeed, I was missing the DOM lib. It wasn't added because I call the Google Maps API from my API backend. Adding it solves this issue.

Thanks for helping!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgoz picture jgoz  路  3Comments

victor-guoyu picture victor-guoyu  路  3Comments

lilling picture lilling  路  3Comments

JudeAlquiza picture JudeAlquiza  路  3Comments

Zzzen picture Zzzen  路  3Comments