1

I am trying to evaluate Heap.io analytics tool for tracking custom errors in React Application. To achieve this, I have integrated Heap base installation script ( https://developers.heap.io/docs/web#base-installation) in main.js file of React Application and then track field validation errors using the script heap.track('Error', {'message': e.message}); in a file where validation error of the application is handled.

On running the application, I found heap has been integrated successfully from developer console script tag <script type="text/javascript" async="" src="https://cdn.heapanalytics.com/js/heap-xxxxxxxx5x.js"></script> and I can able to access heap methods directly from console. But the application breaks and throwing the error (found in console) : Type Error: heap.push is not a function in the application flow where heap.track script is added.

Does anyone have any idea why this error occurs and how to resolve ?

1 Answers1

1

I've been having the same issue as well, and I don't have the solution for it, but I found a github issue related to this. https://github.com/segmentio/analytics.js/issues/605#issuecomment-605464507 It looks like the issue does something to do with the type of heap defined as an object and used as an array.

keiohtani
  • 37
  • 4