MichaelSolati / geofirestore-core

Lightweight location-based querying and encoding of Firebase Firestore Documents for geofirestore.
https://core.geofirestore.com
MIT License
3 stars 9 forks source link

Incorrect import of firebase/app causing typescript compilation error #3

Closed zkhalapyan closed 3 years ago

zkhalapyan commented 3 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

Describe the bug

See error below:

❯ ./node_modules/.bin/tsc --watch
[4:08:38 PM] Starting compilation in watch mode...

node_modules/geofirestore-core/dist/definitions.d.ts:2:10 - error TS2614: Module '"../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../firebase"' instead?

2 import { firestore as webfirestore } from 'firebase/app';
           ~~~~~~~~~

[4:08:43 PM] Found 1 error. Watching for file changes.

Steps to Reproduce

  1. npm install geofirestore
  2. Import geofirestore
  3. Try to compile typescript

Relevant Code

import * as geofirestore from "geofirestore";
zkhalapyan commented 3 years ago

Ah, I see, this is related to https://github.com/MichaelSolati/geofirestore-core/pull/2/commits/4c1cd29b6d298e0980d59c155d504a864d495e4d. Can we please merge in the pull request? Otherwise, the library is not usable.

zkhalapyan commented 3 years ago

Not able to get geofirestore to [install the pull request's version with the fix](

https://stackoverflow.com/questions/64923355/can-you-force-npm-sub-dependency-to-install-from-a-github-pull-request) 😢 Any workarounds you may know?