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 ?