Jblew / firebase-functions-rate-limiter

Js/ts library that allows you to set per-time, per-user or per-anything limits for calling Firebase cloud functions
MIT License
103 stars 15 forks source link

Definitions conflict #42

Open gantonioid opened 2 years ago

gantonioid commented 2 years ago

Description

Trying to add the package in my project, I'm getting build errors

node_modules/@google-cloud/firestore/types/firestore.d.ts:23:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DocumentData, UpdateData, Firestore, GeoPoint, 
Transaction, BulkWriter, BulkWriterError, WriteBatch, SetOptions, WriteResult, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, OrderByDirection, WhereFilterOp, Query, QuerySnapshot, DocumentChangeType, CollectionReference, CollectionGroup, QueryPartition, FieldValue, FieldPath, Timestamp, BundleBuilder, v1beta1, v1, OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, DATA_LOSS, UNAUTHENTICATED, FirebaseFirestore
node_modules/firebase-functions-rate-limiter/node_modules/@google-cloud/firestore/types/firestore.d.ts:23:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DocumentData, UpdateData, Firestore, GeoPoint, Transaction, BulkWriter, BulkWriterError, WriteBatch, SetOptions, WriteResult, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, OrderByDirection, WhereFilterOp, Query, QuerySnapshot, DocumentChangeType, CollectionReference, CollectionGroup, QueryPartition, FieldValue, FieldPath, Timestamp, BundleBuilder, v1beta1, v1, OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, DATA_LOSS, UNAUTHENTICATED, 
FirebaseFirestore

To Reproduce

  1. Firebase functions project, node 16
    "firebase-admin": "^11.1.0",
    "firebase-functions": "^4.0.0",
    "firebase-functions-rate-limiter": "^3.9.1",
    "typescript": "^4.8.4"
  2. npm run build

Environment

Expected Behavior

A successful build

Screenshots

image image

Additional context

bennypowers commented 2 years ago

I'm working around this by removing the link to @google-cloud (npm v8):

# predeploy.sh
if [ -z "$CI_ENVIRONMENT_NAME" ]; then
  # WORKAROUND for https://github.com/Jblew/firebase-functions-rate-limiter/issues/42
  rm -rf functions/node_modules/firebase-functions-rate-limiter/node_modules/@google-cloud/
  npm run build --prefix functions;
fi
omgovich commented 1 year ago

My PR must fix it: https://github.com/Jblew/firebase-functions-rate-limiter/pull/43

But the maintainer has not answered yet =(