Skip to main content
Question

[TypeError: Cannot read property 'identifier' of undefined]

  • April 23, 2024
  • 2 replies
  • 287 views

Forum|alt.badge.img+2

I am setting up a one-time purchase with Revenuecat

I have set up subscriptions before, but never a one-time purchase like the “coins” I am attempting to sell now. 

 

I am logging “currentOffering?.availablePackages and see the correct product I want to sell. When I run:

 

const { customerInfo } = await Purchases.purchasePackage(currentOffering?.availablePackages?.coins);

 

I get this error: 

 

[TypeError: Cannot read property 'identifier' of undefined]

 

Please let me know if you can see what I am doing wrong. Please see the attached screenshot to see what is logging out for my currentOfferings

This post has been closed for comments

2 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • April 26, 2024

Hi, can you make sure you are passing a package to the purchasePackage method? https://revenuecat.github.io/react-native-purchases-docs/7.26.3/classes/default.html#purchasePackage

Additionally, could you please provide the entire debug logs for this? You can enable them here: https://www.revenuecat.com/docs/test-and-launch/debugging#section-debugging


Forum|alt.badge.img+8
  • RevenueCat Staff
  • May 4, 2024

Hi @jacksoRoss apologies, it looks like the post closed out before you could respond. Are you still having problems with this? If so please let me know the information requested in the previous reply.