microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
321 stars 138 forks source link

Incorrect `shutdownStatsbeat` optional parameter handling (TypeError: _this._shutdownStatsbeat is not a function) #1258

Closed mkayander closed 5 months ago

mkayander commented 5 months ago

I've bumped into this issue when using react-native-windows. After a clean project install, I get this error from Sender.ts as I try to run it.

TypeError: _this._shutdownStatsbeat is not a function

After some digging, I found out that the shutdownStatsbeat parameter is optional, however, there is a case when this callback gets called without a check if it exists or not.

This issue needs to be fixed in this repo.

mkayander commented 5 months ago

I've made a PR that would fix this issue. 🙂