-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- Extension name:
firestore-stripe-payments
Describe the bug
Calling getProducts
,createCheckoutSession
or onCurrentUserSubscriptionUpdate
raises an error:
Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore
FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore
To Reproduce
- getProducts
import { getProducts, getStripePayments } from '@invertase/firestore-stripe-payments';
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { initializeFirestore } from 'firebase/firestore';
const app = initializeApp(firebaseConfig);
initializeFirestore(app, {});
const payments = getStripePayments(app, {
productsCollection: 'products',
customersCollection: 'customers',
});
await getProducts(payments);
- createCheckoutSession
import { createCheckoutSession, getStripePayments } from '@invertase/firestore-stripe-payments';
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { initializeFirestore } from 'firebase/firestore';
const app = initializeApp(firebaseConfig);
initializeFirestore(app, {});
const payments = getStripePayments(app, {
productsCollection: 'products',
customersCollection: 'customers',
});
getAuth(app).onAuthStateChanged(async (user) => {
if (user) {
await createCheckoutSession(payments, {
price: '...',
});
});
- onCurrentUserSubscriptionUpdate
import { getStripePayments, onCurrentUserSubscriptionUpdate } from '@invertase/firestore-stripe-payments';
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { initializeFirestore } from 'firebase/firestore';
const app = initializeApp(firebaseConfig);
initializeFirestore(app, {});
const payments = getStripePayments(app, {
productsCollection: 'products',
customersCollection: 'customers',
});
getAuth(app).onAuthStateChanged(async (user) => {
if (user) {
onCurrentUserSubscriptionUpdate(payments, (snapshot) => {});
}
});
Expected behavior
The methods don't error out and perform the operations described in the documentation.
Screenshots

System information
- OS: macOS
- Browser: Chrome
Additional context
I'm using Typescript 5.6.3
and webpack 5.96.1
.
retronym and thetwentyseven
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done