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.

[BUG] Using @microsoft/applicationinsights-web on Nextjs' client-side hangs

See original GitHub issue

Description/Screenshot Using Application Insights to track exceptions that happen on the client-side of a Nextjs application hangs when trying to build (npm run build) the web app.

Here’s a quick video that describes better what’s happening:

https://user-images.githubusercontent.com/31862748/136830875-dde287df-3e08-4c2a-81dd-a356b43edb54.mov

Steps to Reproduce

import { ApplicationInsights } from '@microsoft/applicationinsights-web';

const appInsights = new ApplicationInsights({
  config: {
    instrumentationKey: process.env.NEXT_PUBLIC_APPINSIGHTS_INSTRUMENTATIONKEY,
    autoTrackPageVisitTime: true,
  },
});
appInsights.loadAppInsights();

export default appInsights;

Expected behavior Nextjs web app should build without a problem while using application insights.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MSNevcommented, Oct 13, 2021

Yes, loadAppInsights() is effectively the client side initialization. Without calling this the SDK (on the client side) is not running / listening / initialized.

1reaction
MSNevcommented, Oct 12, 2021

@xiao-lix @kryalama, Do you remember or have a link to the original issue and can you try and repro when you get a chance to see if this is something we can and need to fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next.js dev server gets stuck after a while, requests just spin
Bug report Describe the bug When I run my Next.js app with now dev, after a ... It will work for a while,...
Read more >
Azure Application Insights for JavaScript web apps
Get page view and session counts, web client data, and single-page applications and track usage patterns. Detect exceptions and performance ...
Read more >
Application Insight works fine localhost but in Azure only client ...
Ok, i'm officially an idiot. I had a Web.Config transformation that was supposed to only replace an attribute in the part of Webconfig...
Read more >
Troubleshooting Cloud Functions - Google Cloud
In order to deploy a function, a user who has been assigned the Project Viewer, the Cloud Function Developer, or Cloud Function Admin...
Read more >
You're using HttpClient wrong and it is destabilizing your ...
I know I did. The typical usage pattern looked a little bit like this: using(var client = ...
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