google-maps-services-js
google-maps-services-js copied to clipboard
Error: Cannot find module 'combined-stream
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
Please be sure to include as much information as possible:
Environment details
- zipcode:
3333
- win10
- nodejs, serverless
Code example
# 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);
}
seems like form-data trying to find combined-stream
Following these steps will guarantee the quickest resolution possible.
Thanks!
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@juztinlazaro Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
-
StackOverflow - use the
google-maps
tag
This is an automated message, feel free to ignore.
@amuramoto any thoughts?
When are you seeing this crash? Is it on start up? npm install? Sometime during runtime when the code above is called?
I'm not seeing a similar crash when our test or build steps run. Have you tried wiping node_modules and reinstalling?
@amuramoto yes in startup, FYI im using nodeJS and we deployed it in AWS lambda, already wiping node_modules and reinstalling the packages.
Is this issue still occuring in the latest version?
The combined-stream
package is a transitive dependency of axios
(via form-data
), and should definitely be installed together with axios. If it's not, there's something bad going on that we can't really help debug.