Skip to content

fix(appinsights): inline blazorApplicationInsights JS to fix 404 on _content/ path - #3

Merged
kolatts merged 1 commit into
mainfrom
kolatts/fix-appinsights-inline-js
Mar 21, 2026
Merged

fix(appinsights): inline blazorApplicationInsights JS to fix 404 on _content/ path#3
kolatts merged 1 commit into
mainfrom
kolatts/fix-appinsights-inline-js

Conversation

@kolatts

@kolatts kolatts commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Removes the broken explicit import() call (was fetching from _content/ which 404s — .lib.module.js files from NuGet RCLs are not copied there as regular static assets)
  • Instead, inlines the window.blazorApplicationInsights = {...} setup directly as a second <script> block appended to the AI SDK snippet rendered by the component
  • The JS runs synchronously before OnAfterRenderAsync, guaranteeing window.blazorApplicationInsights is defined when interop calls are made
  • No file serving dependency whatsoever

Test plan

  • Deploy to prod, verify no console errors on load at app.imagile.dev
  • Verify Application Insights receives telemetry with correct cloud role/instance tags

@kolatts
kolatts merged commit a8003ad into main Mar 21, 2026
1 check passed
@kolatts
kolatts deleted the kolatts/fix-appinsights-inline-js branch March 21, 2026 12:40
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

Successfully merging this pull request may close these issues.

1 participant