question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'throwInternal' of undefined

See original GitHub issue

Hi,

When I’m trying to log a trace or an exception I got the following error:

this.applicationInsights = new ApplicationInsights({
  config: {
    instrumentationKey: "some-key"
  }
});
this.applicationInsights.trackTrace({
  message: 'test'
});
logger-service.ts:38 Failed to setup Application Insights TypeError: Cannot read property 'throwInternal' of undefined
    at e.trackTrace (ApplicationInsights.js:114)
    at e.trackTrace (Initialization.js:85)

In _setTelemetryNameAndIKey the value this._globalconfig is undefined. The method _initialize dont seems to be called.

Regards,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ImDmjcommented, May 28, 2019

@jpiyali i am writing test cases with JEST, and i get the same error and all the other test suites fail. is there any way to avoid invoking loadAppInsights() multiple times? can i just mock “loadAppInsights()”

1reaction
jpiyalicommented, Mar 13, 2019

@Socolin - can you please also invoke loadAppInsights().

this.applicationInsights = new ApplicationInsights({
  config: {
    instrumentationKey: "some-key"
  }
});
this.applicationInsights.loadApplicationInsights();

this.applicationInsights.trackTrace({
  message: 'test'
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read properties of undefined ...
I am trying to use React to extract a JSON data from my server and render it with two functions. But it seems...
Read more >
ERROR TypeError: Cannot read property title of undefined
HEY, SET YOUR LIKE THERE ! ... Your browser can't play this video. ... Solved: ERROR TypeError : Cannot read property title of...
Read more >
Renovate Bot Package Diff
- Use this method for sending error telemetry as traditional events to App Insights. This method will automatically drop error properties in certain ......
Read more >
microsoft/applicationinsights-web-basic - UNPKG
strShimFunction) {\r\n throw new TypeError('Object prototype may only be an Object:' + ... throwInternal = function (severity, msgId, msg, properties, ...
Read more >
Cannot read property 'name' of undefined, at Array.forEach
TypeError : Cannot read property 'name' of undefined, at Array.forEach. When I press the button to display the task pane, I am seeing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found