googlemaps / googlemaps/google-maps-services-js

Error: Cannot find module 'combined-stream

Open
#994 5 comments 0 reactions 1 assignee Claimed by @amuramoto View on GitHub
type: question
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

Error: Cannot find module 'combined-stream'\nRequire stack:\n- /var/task/node_modules/@googlemaps/google-maps-services-js/node_modules/form-data/lib/form_data.js

![image](https://github.com/googlemaps/google-maps-services-js/assets/10995629/fa5d321d-28d0-4941-8e4b-503d81ae8ffb)

Please be sure to include as much information as possible:

#### Environment details

1. zipcode: `3333`
2. win10
3. nodejs, serverless

#### Code example

```nodejs
# example

import GoogleMaps from '@googlemaps/google-maps-services-js';

let googleMapsClient;

function createGoogleMapsClient() {
if (googleMapsClient) {
return googleMapsClient;
}
googleMapsClient = GoogleMaps.createClient({
key: process.env.GOOGLE_PLACES_API_KEY,
});

return googleMapsClient;
}

export default createGoogleMapsClient;

export function placesAutoComplete(query, options = {}) {
console.log('placesAutoComplete===');
const components = {};
if (options.countryCode)
components.country =
options.countryCode; /* can't pass undefined as country */
return createGoogleMapsClient()
.places.Autocomplete({
input: query,
components,
types: options.types,
})
.then((response) => response.json.predictions);
}
```

![image](https://github.com/googlemaps/google-maps-services-js/assets/10995629/af16beeb-88b0-4976-8f1e-0ae701431fd7)

seems like form-data trying to find `combined-stream`

![image](https://github.com/googlemaps/google-maps-services-js/assets/10995629/43fecada-73d3-4adb-9866-569b698f116f)

Following these steps will guarantee the quickest resolution possible.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.