From a64f9a8170c6c2baca3df8e916a94fa13a782066 Mon Sep 17 00:00:00 2001 From: siyuniu-ms Date: Thu, 16 Nov 2023 16:36:55 -0800 Subject: [PATCH] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6d5c77541..8700fb4ef 100644 --- a/README.md +++ b/README.md @@ -561,6 +561,8 @@ eg. ```var aiSdk = require("@microsoft/applicationinsights-web");``` This situation can also occur when the scripts are loaded lazily, late or dynamically (__and__ RequireJs is present) as this can cause a race condition between the SDK and RequireJS, which will cause the same issue if RequireJS is loaded first. +If user is loading the Application Insights from the CDN via a script tag with require js running by other scripts, error may occur. A typical error could be "Error: Mismatched anonymous define() module". The root reason is explained [here](https://requirejs.org/docs/errors.html#mismatch). + To support this usage pattern we also produce and publish to the CDN endpoints an [iife (Immediately Invoked Function Expression)](https://www.codeproject.com/Articles/5265230/Understanding-all-JavaScript-Module-Formats-and-To#iife-module-javascript-module-pattern) module so that the SDK is always executed and initialized. To use these modules instead of using the default script name simply add ```.gbl``` before the ```.min.js``` eg. use ```.gbl.min.js``` instead of ```.min.js``` at the end of the script name. (Note: Since version 7, the gbl modules is set to be default.)