Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-Node worker environments #5786

Open
iBobik opened this issue Nov 5, 2024 · 1 comment
Open

Add support for non-Node worker environments #5786

iBobik opened this issue Nov 5, 2024 · 1 comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@iBobik
Copy link

iBobik commented Nov 5, 2024

What would you like to see in the library?

Support for non-NodeJS runtimes like Cloudflare workers. Currently this library fails to compile for Cloudflare when using Nitro framework. In other workers it could just fail in runtime.

Describe alternatives you've considered

It works to use this library only for Typescript types and send requests the other way:

import type { protos } from '@googlemaps/places'

const data = await $fetch<protos.google.maps.places.v1.IAutocompletePlacesResponse>('https://places.googleapis.com/v1/places:autocomplete', {
  method: 'POST',
  body: {
    input,
    languageCode: language,
    sessionToken,
    locationBias: { rectangle: {
      low: { latitude: businessArea.minLat, longitude: businessArea.minLng },
      high: { latitude: businessArea.maxLat, longitude: businessArea.maxLng },
    } },
  } as protos.google.maps.places.v1.IAutocompletePlacesRequest,
  headers: { 'X-Goog-Api-Key': googleMapsApiKey },
})
@sofisl sofisl added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Nov 5, 2024
@OultimoCoder
Copy link

Please do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants