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

GeoPoint undefined in 11.0.1 #1908

Closed
wengweng opened this issue Sep 21, 2022 · 3 comments
Closed

GeoPoint undefined in 11.0.1 #1908

wengweng opened this issue Sep 21, 2022 · 3 comments

Comments

@wengweng
Copy link

var admin = require("firebase-admin");

new admin.firestore.GeoPoint(latitude, longitude); // Gives error -> TypeError: GeoPoint is not a constructor

The value of admin.firestore.GeoPoint is undefined

I've reverted back to version 10.3.0 and the code works again.

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@lahirumaramba
Copy link
Member

This seems similar to #1827
Could you try importing the class using the modular API? More examples are on: #1827 (comment)

import { getFirestore, GeoPoint } from 'firebase-admin/firestore';

@alexjordi
Copy link

I am having an issue using the geopoint constructor.

const GeoPoint = admin.firestore.GeoPoint;

....

const geopoint = new GeoPoint(latitude, longitude);
// Add 'g' entry to data
data['g'] = {
  geopoint: geopoint,
  'geohash': computedGeohash
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants