From 007204bbc28638d8327c69e0bc72eba59b620238 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Tue, 8 Sep 2026 13:45:57 -0700 Subject: [PATCH] Fix ESM XHR instrumentation tree shaking Remove the no-side-effects annotation from isXhrSupported so Rollup preserves capability checks that install XHR instrumentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- shared/AppInsightsCore/src/utils/EnvUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/AppInsightsCore/src/utils/EnvUtils.ts b/shared/AppInsightsCore/src/utils/EnvUtils.ts index b8209b2b1..67a16a25e 100644 --- a/shared/AppInsightsCore/src/utils/EnvUtils.ts +++ b/shared/AppInsightsCore/src/utils/EnvUtils.ts @@ -290,7 +290,8 @@ export function useXDomainRequest(): boolean | undefined { * Checks if XMLHttpRequest is supported * @returns True if supported, otherwise false */ -/*#__NO_SIDE_EFFECTS__*/ +// Do not mark this function as side-effect-free. Rollup can remove capability checks +// guarded by this return value, which prevents XHR instrumentation from being installed. export function isXhrSupported(): boolean { let isSupported = false; try {