Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appInsightsService.queue set to undefined #75

Open
mostafa-raafat opened this issue May 29, 2019 · 1 comment
Open

appInsightsService.queue set to undefined #75

mostafa-raafat opened this issue May 29, 2019 · 1 comment

Comments

@mostafa-raafat
Copy link

mostafa-raafat commented May 29, 2019

only first time i'm in home no error and session is set then whenever i back to home again
i got Uncaught TypeError: Cannot read property 'push' of undefined

` ngOnInit(): void {

this.eventManager.navigate.subscribe((path: any) => {
  if (path.url === '/') {
    this.startSession();
  }
});

}`

` private startSession(): void {

this.appInsightsService.queue.push(() => {
  this.appInsightsService.context.addTelemetryInitializer((envelope: Microsoft.ApplicationInsights.IEnvelope) => {
    envelope.tags['ai.session.id'] = uuid();
    envelope.tags['ai.device.id'] = this.env.store.unitName;
  });
});

}`

@MarkPieszak
Copy link
Member

It seems others have ran into this one as well, can you check out #47 and see if that can fix it for you? We pushed a fix via #57 that should help prevent this from happening.

Let me know what you have to do to prevent this, we can make sure we add it to the Documentation for others in the future! Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants