Question

Cannot read property 'productIdentifier' of undefined

  • 23 January 2024
  • 2 replies
  • 32 views

Badge +6

I have seen this error sometimes:

Cannot read property 'productIdentifier' of undefined

Why would RevenueCat have an incomplete response when: const info = await Purchases.getCustomerInfo();

Then I access by:
info?.entitlements?.active?.[entitlementName]?.productIdentifier

 

This only seems to be in production, of course.


2 replies

Userlevel 4
Badge +6

Hey @lucksp !

 

Are you able to reproduce this? It could be internet related or something causing an interruption, but if you are able to debug this can you please create a support ticket so we can look further into what might be happening here? 

 

Ticket form: https://app.revenuecat.com/settings/support

 

We look forward to helping! 

Badge +6

I can’t replicate it, but I had seen this error surprising amount in my BugSnag reporting:

 

 

It does seem like it’s related to AppState change of inactive/active...but there is connectivity always it seems in terms of WiFi or Mobile Network.


I put optional chaining on all the RevenueCat results…

 

I do have my logs for you set to Debug, so i hope they can find something when I submit the support request.

Reply