Comments (4)
The error is saying that the JS Interop can't find the appInsights JavaScript object.
Have you added the JS snippet to the index.html?
Example,
from blazorapplicationinsights.
Yes, as mentioned, it does work if I reload the page.
from blazorapplicationinsights.
I just checked one of my work projects which uses auth. I am not seeing the same issue that you're experiencing.
Here is the App.razor
<CascadingAuthenticationState>
<CascadingBlazoredModal>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
@if (!context.User.Identity.IsAuthenticated)
{
<RedirectToLogin />
}
else
{
<p>You are not authorized to access this resource.</p>
}
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingBlazoredModal>
</CascadingAuthenticationState>
<ApplicationInsightsComponent />
I wonder if this is a timing issue. Can you please edit your JS snippet and set the ld parameter to -1.
ld: -1, // Defines the load delay (in ms) before attempting to load the sdk. -1 = block page load and add to head. (default) = 0ms
from blazorapplicationinsights.
I had this issue happen to me, I tested with ld = -1 and it hasn't reoccurred. I have updated the installation guidance in the readme. Let me know if you see this issue again.
from blazorapplicationinsights.
Related Issues (20)
- Everything working but TrackEvent? HOT 3
- Dependency Dashboard
- Could not find 'appInsights.updateCfg' (Blazor Web Assembly stand-alone) HOT 4
- ConnectionString from server to client with v3.0.0 HOT 1
- Blazor Server -- updated to latest package, how to initialize... HOT 3
- Improve the error message when the SetAuthenticatedUserContext called too early
- Question: Is ASP.NET Core Hosted model supported for .NET 8? HOT 1
- Ingestion Endpoint in Connection String not respected in WASM standalone mode HOT 2
- Error after upgrading to 3.0.3 HOT 6
- Confusion about how to configure the application in a Blazor WASM Standalone application HOT 1
- NuGet Package 3.0.4 Application cannot start HOT 3
- Blazor Web App with Telemetry Initializer: Could not find 'blazorApplicationInsights.addTelemetryInitializer' ('blazorApplicationInsights' was undefined). HOT 2
- Script issues and vulnerabilities HOT 2
- Bug when combining Serilog HOT 1
- Missing "sampleRate" property on ITelemetryItem HOT 1
- FireFox: Could not find 'appInsights.updateCfg' ('updateCfg' was undefined). HOT 11
- Injection of the _content/BlazorApplicationInsights script fails when app is configured to serve static files from a folder
- Configure minimum LogLevel HOT 2
- Pass `IServiceProvider` to the `applicationInsights` lambda in order to make it more effective
- No telemetry after upgrading from 2.2.0 with dotnet 7 to 3.0.5 with dotnet 8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorapplicationinsights.