Definitelytyped: @types/googlemaps/index.d.ts is not a module

Created on 26 Aug 2019  路  9Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/xxxx package and had problems.
  • [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [ ] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [ ] [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: @....

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

Most helpful comment

@RobertAKARobin @alambertt try the following steps:

  1. npm install @types/googlemaps --save-dev
  2. add "types": ["googlemaps"] in tsconfig.app.json file
  3. remove import {} from 'googlemaps'; from your code.

All 9 comments

Could you explain your specific use case that caused this issue?

@ziyaddin I have this same error. I'm running an Angular 8 app. I run:

npm i --save-dev @types/googlemaps

Then, in a component file, I include:

import {} from 'googlemaps';

I receive the error:

...'node_modules/@types/googlemaps/index.d.ts' is not a module.

Me too

@RobertAKARobin @alambertt try the following steps:

  1. npm install @types/googlemaps --save-dev
  2. add "types": ["googlemaps"] in tsconfig.app.json file
  3. remove import {} from 'googlemaps'; from your code.

@ziyaddin

This also worked for me on Angular 8. Thank you so much!

@RobertAKARobin @alambertt try the following steps:

  1. npm install @types/googlemaps --save-dev
  2. add "types": ["googlemaps"] in tsconfig.app.json file
  3. remove import {} from 'googlemaps'; from your code.

I wrote this in the first line of my .ts and worked 100%
/// <reference types="@types/googlemaps" />

@RobertAKARobin @alambertt try the following steps:

  1. npm install @types/googlemaps --save-dev
  2. add "types": ["googlemaps"] in tsconfig.app.json file
  3. remove import {} from 'googlemaps'; from your code.

I wrote this in the first line of my .ts and worked 100%
/// <reference types="@types/googlemaps" />

Where did you added exactly?

@RobertAKARobin @alambertt try the following steps:

  1. npm install @types/googlemaps --save-dev
  2. add "types": ["googlemaps"] in tsconfig.app.json file
  3. remove import {} from 'googlemaps'; from your code.

I wrote this in the first line of my .ts and worked 100%
/// <reference types="@types/googlemaps" />

Where did you added exactly?

index.html

---add "types": ["googlemaps"] in tsconfig.app.json file ---
in section "compilerOptions": work for me

Was this page helpful?
0 / 5 - 0 ratings