question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot file module 'google

See original GitHub issue

Issue description Hi 😃

Im using this library with google places api. So I lazy load the js file:

this.places = new google.maps.places.Autocomplete(el.nativeElement.children[0], {
        types: ['(cities)'],
        componentRestrictions: { country: 'fr' }
      });

The problem is that the typescript compiler is telling me Cannot find name 'google' since it loads dynamically I guess i cannot use the /// <reference path="???" />

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
warapitiyacommented, Jul 31, 2016

Not working for me, Any snippet would be grate?

3reactions
natharduinicommented, Feb 16, 2018

A bit late to the party, but in case someone ends up on this page… This worked for me:

npm install @types/googlemaps --save

Then in the component where I use the google name:

import { } from '@types/googlemaps';

I hope it helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find module 'google-module' - Stack Overflow
cannot find module 'google-module' · This is using an older google-cloud library version. · looks like npm was able to add the dependencies....
Read more >
Error: Cannot find module 'google-cloud' · Issue #56 - GitHub
The dependencies were recently updated to latest which very likely fixes this. If the issue persists, feel free to reopen. All ...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
Why the "Error: cannot find module" Occurs · you're trying to import an item from a module you don't have installed in your...
Read more >
Failed to import the Cloud Firestore client library for Node.js ...
js. Make sure to install the "@google-cloud/firestore" npm package. Original error: Error: Cannot find module 'is-set'.
Read more >
Error [ERR_MODULE_NOT_FOUND]: Cannot find module in JS
The "Error [ERR_MODULE_NOT_FOUND]: Cannot find module" occurs when you set the type attribute to module in your package.json file, but omit the file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found